summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorOlivier CHURLAUD <olivier@churlaud.com>2016-07-15 19:05:38 (GMT)
committerOlivier CHURLAUD <olivier@churlaud.com>2016-07-15 19:14:50 (GMT)
commit741c616c7a0483f8b232bfd756dcd8fcbf6ba314 (patch)
treeb7db4a4ba7dcc3cdf0159219b2a82e3075a77450
parent1f69f5fdcc038ed74e94b8c3f37db4da80a81487 (diff)
Port most of part.cpp out of KDELibsSupport
minor: Change header cases : <qicon.h> becomes <QIcon>
-rw-r--r--CMakeLists.txt3
-rw-r--r--part.cpp80
-rw-r--r--part.h27
3 files changed, 56 insertions, 54 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 4ccbb37..7734ed9 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -18,7 +18,7 @@ include(KDEFrameworkCompilerSettings NO_POLICY_SCOPE)
include(KDEInstallDirs)
include(KDECMakeSettings)
include(ECMAddTests)
-include(ECMAddAppIcon)
+include(ECMAddAppIcon)
include(ECMPackageConfigHelpers)
ecm_setup_version(1.0.0 VARIABLE_PREFIX OKULAR
@@ -312,6 +312,7 @@ target_link_libraries(okularpart okularcore
Qt5::Svg
Phonon::phonon4qt5
KF5::Archive
+ KF5::Bookmarks
KF5::IconThemes
KF5::KDELibs4Support
KF5::Parts
diff --git a/part.cpp b/part.cpp
index 174eed0..e38e701 100644
--- a/part.cpp
+++ b/part.cpp
@@ -25,53 +25,53 @@
// qt/kde includes
#include <QApplication>
+#include <QDialog>
+#include <QDialogButtonBox>
#include <QFile>
+#include <QFileDialog>
+#include <QIcon>
+#include <QInputDialog>
#include <QLayout>
#include <QLabel>
+#include <QMenu>
#include <QTimer>
#include <QTemporaryFile>
-#include <QtPrintSupport/QPrinter>
-#include <QtPrintSupport/QPrintDialog>
+#include <QPrinter>
+#include <QPrintDialog>
+#include <QPrintPreviewDialog>
#include <QScrollBar>
-#include <QInputDialog>
-#include <QWidgetAction>
-#include <QFileDialog>
-#include <QDialog>
-#include <QDialogButtonBox>
-#include <QStandardPaths>
#include <QSlider>
#include <QSpinBox>
+#include <QStandardPaths>
+#include <QWidgetAction>
-#include <Kdelibs4Migration>
+#include <KAboutApplicationDialog>
+#include <KActionCollection>
+#include <KBookmarkAction>
+#include <KBookmarkMenu>
#include <Kdelibs4ConfigMigrator>
+#include <Kdelibs4Migration>
+#include <KDirWatch>
+#include <KFilterBase>
+#include <KFilterDev>
+#include <KIO/Job>
#include <KJobWidgets>
-#include <kaboutapplicationdialog.h>
-#include <kactioncollection.h>
-#include <kbookmarkaction.h>
-#include <kdirwatch.h>
-#include <kstandardaction.h>
-#include <kpluginfactory.h>
+#include <KMessageBox>
+#include <KPasswordDialog>
+#include <KPluginFactory>
#include <KPluginMetaData>
-#include <kmessagebox.h>
-#include <kio/netaccess.h>
-#include <kmenu.h>
-#include <kxmlguiclient.h>
-#include <kxmlguifactory.h>
-#include <kstandardshortcut.h>
-#include <ktoggleaction.h>
-#include <ktogglefullscreenaction.h>
-#include <kio/job.h>
-#include <QIcon>
-#include <kfilterdev.h>
-#include <kfilterbase.h>
+#include <KSharedDataCache>
+#include <KStandardShortcut>
+#include <KToggleAction>
+#include <KToggleFullScreenAction>
+#include <KWallet>
+#include <KXMLGUIClient>
+#include <KXMLGUIFactory>
+
#if 0
#include <knewstuff2/engine.h>
#endif
-#include <kdeprintdialog.h>
-#include <kprintpreview.h>
-#include <kbookmarkmenu.h>
-#include <kpassworddialog.h>
-#include <kwallet.h>
+
#include <kdeversion.h>
// local includes
@@ -2461,7 +2461,7 @@ void Part::slotPrintPreview()
// Native printing supports KPrintPreview, Postscript needs to use FilePrinterPreview
if ( m_document->printingSupport() == Okular::Document::NativePrinting )
{
- KPrintPreview previewdlg( &printer, widget() );
+ QPrintPreviewDialog previewdlg( &printer, widget() );
setupPrint( printer );
doPrint( printer );
previewdlg.exec();
@@ -2740,14 +2740,14 @@ void Part::slotPrint()
{
printConfigWidget = m_document->printConfigurationWidget();
}
- if ( printConfigWidget )
- {
- printDialog = KdePrint::createPrintDialog( &printer, QList<QWidget*>() << printConfigWidget, widget() );
- }
- else
- {
- printDialog = KdePrint::createPrintDialog( &printer, widget() );
+
+ printDialog = new QPrintDialog(&printer, widget());
+ printDialog->setWindowTitle(i18nc("@title:window", "Print"));
+ QList<QWidget*> options;
+ if (printConfigWidget) {
+ options << printConfigWidget;
}
+ printDialog->setOptionTabs(options);
if ( printDialog )
{
diff --git a/part.h b/part.h
index f6361b1..a9b0b73 100644
--- a/part.h
+++ b/part.h
@@ -16,16 +16,19 @@
#ifndef _PART_H_
#define _PART_H_
-#include <kparts/readwritepart.h>
-#include <kpluginfactory.h>
-#include <kmessagewidget.h>
-#include <KCompressionDevice>
-#include <qicon.h>
-#include <qlist.h>
-#include <qpointer.h>
-#include <qprocess.h>
+#include <QIcon>
+#include <QList>
+#include <QPointer>
+#include <QProcess>
+#include <QtDBus>
#include <QUrl>
-#include <kio/job.h>
+
+#include <KCompressionDevice>
+#include <KIO/Job>
+#include <KMessageWidget>
+#include <KParts/ReadWritePart>
+#include <KPluginFactory>
+
#include "core/observer.h"
#include "core/document.h"
#include "kdocumentviewer.h"
@@ -33,8 +36,6 @@
#include "okularpart_export.h"
-#include <QtDBus/QtDBus>
-
class QAction;
class QWidget;
class QPrinter;
@@ -102,7 +103,7 @@ class OKULARPART_EXPORT Part : public KParts::ReadWritePart, public Okular::Docu
Q_CLASSINFO("D-Bus Interface", "org.kde.okular")
Q_INTERFACES(KDocumentViewer)
Q_INTERFACES(Okular::ViewerInterface)
-
+
friend class PartTest;
public:
@@ -253,7 +254,7 @@ class OKULARPART_EXPORT Part : public KParts::ReadWritePart, public Okular::Docu
void unsetDummyMode();
void slotRenameBookmark( const DocumentViewport &viewport );
void resetStartArguments();
-
+
static int numberOfParts;
QTemporaryFile *m_tempfile;