simplify by not having a subclass just to call a method

This commit is contained in:
Aaron Seigo 2012-05-22 15:27:26 +02:00
parent 60d38e7970
commit 2552bf6976
4 changed files with 5 additions and 80 deletions

View file

@ -3,7 +3,6 @@ include_directories( ${KDE4_INCLUDES} ${QT_INCLUDES})
set(active-documentviewer_SRCS set(active-documentviewer_SRCS
main.cpp main.cpp
documentviewer.cpp
) )
kde4_add_kdeinit_executable(active-documentviewer ${active-documentviewer_SRCS}) kde4_add_kdeinit_executable(active-documentviewer ${active-documentviewer_SRCS})

View file

@ -1,37 +0,0 @@
/***************************************************************************
* *
* Copyright 2011 Sebastian Kügler <sebas@kde.org> *
* Copyright 2012 Marco Martin <mart@kde.org> *
* *
* This program is free software; you can redistribute it and/or modify *
* it under the terms of the GNU General Public License as published by *
* the Free Software Foundation; either version 2 of the License, or *
* (at your option) any later version. *
* *
* This program is distributed in the hope that it will be useful, *
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
* GNU General Public License for more details. *
* *
* You should have received a copy of the GNU General Public License *
* along with this program; if not, write to the *
* Free Software Foundation, Inc., *
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA . *
***************************************************************************/
#include "documentviewer.h"
#include "kdeclarativeview.h"
DocumentViewer::DocumentViewer()
: KDeclarativeMainWindow()
{
declarativeView()->setPackageName("org.kde.active.documentviewer");
}
DocumentViewer::~DocumentViewer()
{
}
#include "documentviewer.moc"

View file

@ -1,41 +0,0 @@
/***************************************************************************
* *
* Copyright 2011 Sebastian Kügler <sebas@kde.org> *
* Copyright 2012 Marco Martin <mart@kde.org> *
* *
* This program is free software; you can redistribute it and/or modify *
* it under the terms of the GNU General Public License as published by *
* the Free Software Foundation; either version 2 of the License, or *
* (at your option) any later version. *
* *
* This program is distributed in the hope that it will be useful, *
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
* GNU General Public License for more details. *
* *
* You should have received a copy of the GNU General Public License *
* along with this program; if not, write to the *
* Free Software Foundation, Inc., *
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA . *
***************************************************************************/
#ifndef DOCUMENTVIEWER_H
#define DOCUMENTVIEWER_H
#include "kdeclarativemainwindow.h"
#include <KProcess>
class DirModel;
class DocumentViewer : public KDeclarativeMainWindow
{
Q_OBJECT
public:
DocumentViewer();
virtual ~DocumentViewer();
};
#endif // DOCUMENTVIEWER_H

View file

@ -27,6 +27,9 @@
#include <KDE/KLocale> #include <KDE/KLocale>
#include <KConfigGroup> #include <KConfigGroup>
#include "kdeclarativemainwindow.h"
#include "kdeclarativeview.h"
// Own // Own
#include "documentviewer.h" #include "documentviewer.h"
@ -56,7 +59,8 @@ KDE_EXPORT int kdemain(int argc, char **argv)
//kDebug() << "ARGS:" << args << args->count(); //kDebug() << "ARGS:" << args << args->count();
DocumentViewer *mainWindow = new DocumentViewer(); KDeclarativeMainWindow *mainWindow = new KDeclarativeMainWindow();
mainWindow->declarativeView()->setPackageName("org.kde.active.documentviewer");
mainWindow->show(); mainWindow->show();
args->clear(); args->clear();
return app.exec(); return app.exec();