diff --git a/conf/preferencesdialog.cpp b/conf/preferencesdialog.cpp index f0c3f2c7d..096bee1da 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 11e0e56a5..02de6aed9 100644 --- a/core/document.cpp +++ b/core/document.cpp @@ -39,7 +39,6 @@ #include #include #include -#include #include #include #include diff --git a/core/document.h b/core/document.h index 567417381..bf002151b 100644 --- a/core/document.h +++ b/core/document.h @@ -23,9 +23,9 @@ #include #include +#include class QPrintDialog; -class KComponentData; class KBookmark; class KConfigDialog; class KXMLGUIClient; diff --git a/extensions.h b/extensions.h index dcd5c1cb8..a2a2db69b 100644 --- a/extensions.h +++ b/extensions.h @@ -12,6 +12,7 @@ #define _EXTENSIONS_H_ #include +#include namespace Okular { diff --git a/generators/txt/generator_txt.cpp b/generators/txt/generator_txt.cpp index e9b21b99e..6ff3d3824 100644 --- a/generators/txt/generator_txt.cpp +++ b/generators/txt/generator_txt.cpp @@ -12,6 +12,7 @@ #include "converter.h" #include +#include #include static KAboutData createAboutData() diff --git a/part.cpp b/part.cpp index 13b55df6f..ae7996443 100644 --- a/part.cpp +++ b/part.cpp @@ -37,6 +37,7 @@ #include #include #include +#include #include #include #include @@ -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 094d836c0..2b02ab952 100644 --- a/part.h +++ b/part.h @@ -16,7 +16,7 @@ #ifndef _PART_H_ #define _PART_H_ -#include +#include #include #include #include @@ -24,6 +24,7 @@ #include #include #include +#include #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;