summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFrederik Gladhorn <frederik.gladhorn@digia.com>2014-08-09 23:08:54 (GMT)
committerFrederik Gladhorn <frederik.gladhorn@digia.com>2014-08-09 23:08:54 (GMT)
commit96b0e27c44ce8a4b5c6ca19aed518a27e4953350 (patch)
tree5ec109bc64c778bb25a3a1e79ae0e97029d32e0e
parent4ce837a7ac50f97654990f13a028d18cecd44b33 (diff)
QAction, more includes fixed
-rw-r--r--conf/preferencesdialog.cpp2
-rw-r--r--core/document.cpp1
-rw-r--r--core/document.h2
-rw-r--r--extensions.h1
-rw-r--r--generators/txt/generator_txt.cpp1
-rw-r--r--part.cpp23
-rw-r--r--part.h55
7 files changed, 44 insertions, 41 deletions
diff --git a/conf/preferencesdialog.cpp b/conf/preferencesdialog.cpp
index f0c3f2c..096bee1 100644
--- a/conf/preferencesdialog.cpp
+++ b/conf/preferencesdialog.cpp
@@ -42,7 +42,7 @@ PreferencesDialog::PreferencesDialog( QWidget * parent, KConfigSkeleton * skelet
addPage( m_performance, i18n("Performance"), "preferences-system-performance", i18n("Performance Tuning") );
if( embedMode == Okular::ViewerWidgetMode )
{
- setCaption( i18n("Configure Viewer") );
+ setWindowTitle( i18n("Configure Viewer") );
}
else
{
diff --git a/core/document.cpp b/core/document.cpp
index 11e0e56..02de6ae 100644
--- a/core/document.cpp
+++ b/core/document.cpp
@@ -39,7 +39,6 @@
#include <kaboutdata.h>
#include <k4aboutdata.h>
#include <kauthorized.h>
-#include <kcomponentdata.h>
#include <kconfigdialog.h>
#include <kdebug.h>
#include <klibloader.h>
diff --git a/core/document.h b/core/document.h
index 5674173..bf00215 100644
--- a/core/document.h
+++ b/core/document.h
@@ -23,9 +23,9 @@
#include <QtXml/QDomDocument>
#include <kmimetype.h>
+#include <kcomponentdata.h>
class QPrintDialog;
-class KComponentData;
class KBookmark;
class KConfigDialog;
class KXMLGUIClient;
diff --git a/extensions.h b/extensions.h
index dcd5c1c..a2a2db6 100644
--- a/extensions.h
+++ b/extensions.h
@@ -12,6 +12,7 @@
#define _EXTENSIONS_H_
#include <kparts/browserextension.h>
+#include <kparts/liveconnectextension.h>
namespace Okular
{
diff --git a/generators/txt/generator_txt.cpp b/generators/txt/generator_txt.cpp
index e9b21b9..6ff3d38 100644
--- a/generators/txt/generator_txt.cpp
+++ b/generators/txt/generator_txt.cpp
@@ -12,6 +12,7 @@
#include "converter.h"
#include <kaboutdata.h>
+#include <klocalizedstring.h>
#include <KConfigDialog>
static KAboutData createAboutData()
diff --git a/part.cpp b/part.cpp
index 13b55df..ae79964 100644
--- a/part.cpp
+++ b/part.cpp
@@ -37,6 +37,7 @@
#include <kaboutapplicationdialog.h>
#include <kaction.h>
#include <kactioncollection.h>
+#include <kbookmarkaction.h>
#include <kdirwatch.h>
#include <kstandardaction.h>
#include <kpluginfactory.h>
@@ -210,7 +211,7 @@ static QString compressedMimeFor( const QString& mime_to_check )
compressedMimeMap[ QString::fromLatin1( "application/x-bzdvi" ) ] = app_bzip;
compressedMimeMap[ QString::fromLatin1( "image/x-bzeps" ) ] = app_bzip;
}
- // check we can read XZ-compressed files
+ // check if we can read XZ-compressed files
f.reset( KFilterBase::findFilterByMimeType( app_xz ) );
if ( f.get() )
{
@@ -713,7 +714,7 @@ void Part::setupViewerActions()
reload->setIcon( KIcon( "view-refresh" ) );
reload->setWhatsThis( i18n( "Reload the current document from disk." ) );
connect( reload, SIGNAL(triggered()), this, SLOT(slotReload()) );
- reload->setShortcut( KStandardShortcut::reload() );
+ reload->setShortcut( QKeySequence(QKeySequence::Refresh) );
m_reload = reload;
m_closeFindBar = ac->addAction( "close_find_bar", this, SLOT(slotHideFindBar()) );
@@ -755,7 +756,7 @@ void Part::setupActions()
m_saveCopyAs = KStandardAction::saveAs( this, SLOT(slotSaveCopyAs()), ac );
m_saveCopyAs->setText( i18n( "Save &Copy As..." ) );
- m_saveCopyAs->setShortcut( KShortcut() );
+ m_saveCopyAs->setShortcut( QKeySequence(QKeySequence::SaveAs) );
ac->addAction( "file_save_copy", m_saveCopyAs );
m_saveCopyAs->setEnabled( false );
@@ -1050,7 +1051,7 @@ void Part::loadCancelled(const QString &reason)
{
if (!reason.isEmpty())
{
- KMessageBox::error( widget(), i18n("Could not open %1. Reason: %2", url().prettyUrl(), reason ) );
+ KMessageBox::error( widget(), i18n("Could not open %1. Reason: %2", url().toDisplayString(), reason ) );
}
}
}
@@ -1081,11 +1082,11 @@ KConfigDialog * Part::slotGeneratorPreferences( )
if( m_embedMode == ViewerWidgetMode )
{
- dialog->setCaption( i18n( "Configure Viewer Backends" ) );
+ dialog->setWindowTitle( i18n( "Configure Viewer Backends" ) );
}
else
{
- dialog->setCaption( i18n( "Configure Backends" ) );
+ dialog->setWindowTitle( i18n( "Configure Backends" ) );
}
m_document->fillConfigDialog( dialog );
@@ -1224,7 +1225,7 @@ bool Part::openFile()
{
KMimeType::Ptr mime;
QString fileNameToOpen = localFilePath();
- const bool isstdin = url().isLocalFile() && url().fileName( KUrl::ObeyTrailingSlash ) == QLatin1String( "-" );
+ const bool isstdin = url().isLocalFile() && url().adjusted(QUrl::RemoveFilename) == QLatin1String( "-" );
const QFileInfo fileInfo( fileNameToOpen );
if ( !isstdin && !fileInfo.exists() )
return false;
@@ -1304,7 +1305,7 @@ bool Part::openFile()
// if the user presses cancel, abort opening
KPasswordDialog dlg( widget(), wallet ? KPasswordDialog::ShowKeepPassword : KPasswordDialog::KPasswordDialogFlags() );
- dlg.setCaption( i18n( "Document Password" ) );
+ dlg.setWindowTitle( i18n( "Document Password" ) );
dlg.setPrompt( prompt );
if( !dlg.exec() )
break;
@@ -2083,7 +2084,7 @@ void Part::slotPreviousBookmark()
if ( !bookmark.isNull() )
{
- DocumentViewport vp( bookmark.url().htmlRef() );
+ DocumentViewport vp( bookmark.url().fragment(QUrl::FullyDecoded) );
m_document->setViewport( vp );
}
}
@@ -2095,7 +2096,7 @@ void Part::slotNextBookmark()
if ( !bookmark.isNull() )
{
- DocumentViewport vp( bookmark.url().htmlRef() );
+ DocumentViewport vp( bookmark.url().fragment(QUrl::FullyDecoded) );
m_document->setViewport( vp );
}
}
@@ -2574,7 +2575,7 @@ void Part::slotExportAs(QAction * act)
filter = m_exportFormats.at( id - 2 ).mimeType()->name();
break;
}
- QString fileName = KFileDialog::getSaveFileName( url().isLocalFile() ? url().directory() : QString(),
+ QString fileName = KFileDialog::getSaveFileName( url().isLocalFile() ? url().adjusted(QUrl::RemoveFilename) : QString(),
filter, widget(), QString(),
KFileDialog::ConfirmOverwrite );
if ( !fileName.isEmpty() )
diff --git a/part.h b/part.h
index 094d836..2b02ab9 100644
--- a/part.h
+++ b/part.h
@@ -16,7 +16,7 @@
#ifndef _PART_H_
#define _PART_H_
-#include <kparts/part.h>
+#include <kparts/readwritepart.h>
#include <kpluginfactory.h>
#include <kmessagewidget.h>
#include <qicon.h>
@@ -24,6 +24,7 @@
#include <qpointer.h>
#include <qprocess.h>
#include <kurl.h>
+#include <kio/job.h>
#include "core/observer.h"
#include "core/document.h"
#include "kdocumentviewer.h"
@@ -293,39 +294,39 @@ class OKULAR_PART_EXPORT Part : public KParts::ReadWritePart, public Okular::Doc
QStringList m_searchHistory;
// actions
- KAction *m_gotoPage;
- KAction *m_prevPage;
- KAction *m_nextPage;
- KAction *m_beginningOfDocument;
- KAction *m_endOfDocument;
- KAction *m_historyBack;
- KAction *m_historyNext;
- KAction *m_addBookmark;
- KAction *m_renameBookmark;
- KAction *m_prevBookmark;
- KAction *m_nextBookmark;
- KAction *m_copy;
- KAction *m_selectAll;
- KAction *m_find;
- KAction *m_findNext;
- KAction *m_findPrev;
- KAction *m_saveAs;
- KAction *m_saveCopyAs;
- KAction *m_printPreview;
- KAction *m_showProperties;
- KAction *m_showEmbeddedFiles;
- KAction *m_exportAs;
+ QAction *m_gotoPage;
+ QAction *m_prevPage;
+ QAction *m_nextPage;
+ QAction *m_beginningOfDocument;
+ QAction *m_endOfDocument;
+ QAction *m_historyBack;
+ QAction *m_historyNext;
+ QAction *m_addBookmark;
+ QAction *m_renameBookmark;
+ QAction *m_prevBookmark;
+ QAction *m_nextBookmark;
+ QAction *m_copy;
+ QAction *m_selectAll;
+ QAction *m_find;
+ QAction *m_findNext;
+ QAction *m_findPrev;
+ QAction *m_saveAs;
+ QAction *m_saveCopyAs;
+ QAction *m_printPreview;
+ QAction *m_showProperties;
+ QAction *m_showEmbeddedFiles;
+ QAction *m_exportAs;
QAction *m_exportAsText;
QAction *m_exportAsDocArchive;
- KAction *m_showPresentation;
+ QAction *m_showPresentation;
KToggleAction* m_showMenuBarAction;
KToggleAction* m_showLeftPanel;
KToggleAction* m_showBottomBar;
KToggleFullScreenAction* m_showFullScreenAction;
- KAction *m_aboutBackend;
- KAction *m_reload;
+ QAction *m_aboutBackend;
+ QAction *m_reload;
QMenu *m_exportAsMenu;
- KAction *m_closeFindBar;
+ QAction *m_closeFindBar;
bool m_actionsSearched;
BrowserExtension *m_bExtension;