summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMontel Laurent <montel@kde.org>2014-10-01 05:27:09 (GMT)
committerMontel Laurent <montel@kde.org>2014-10-01 05:27:09 (GMT)
commit378f6847a2cf6820c395b34b1850a28e5fd8d65d (patch)
tree4683760914dd0f580ade8798b2d616d9dafa6661
parent9cc0f6bc39ff51a1f8fcf4b6c06e10a9d7fb15fb (diff)
Remove some deprecated kdelibs4support
-rw-r--r--active/app/src/main.cpp3
-rw-r--r--active/components/okularplugin.cpp3
-rw-r--r--core/document.cpp18
-rw-r--r--core/script/kjs_app.cpp2
-rw-r--r--generators/chm/generator_chm.cpp2
-rw-r--r--generators/dvi/pageSize.cpp8
-rw-r--r--generators/epub/epubdocument.cpp2
-rw-r--r--generators/fictionbook/converter.cpp2
-rw-r--r--generators/ooo/styleparser.cpp4
-rw-r--r--generators/poppler/generator_pdf.cpp4
-rw-r--r--generators/tiff/generator_tiff.cpp2
-rw-r--r--generators/xps/generator_xps.cpp6
-rw-r--r--part.cpp10
-rw-r--r--ui/annotationpropertiesdialog.cpp6
-rw-r--r--ui/annotwindow.cpp2
-rw-r--r--ui/embeddedfilesdialog.cpp5
-rw-r--r--ui/findbar.cpp4
-rw-r--r--ui/guiutils.cpp2
-rw-r--r--ui/latexrenderer.cpp2
-rw-r--r--ui/pageview.cpp30
-rw-r--r--ui/pageviewannotator.cpp2
-rw-r--r--ui/side_reviews.cpp2
-rw-r--r--ui/sidebar.cpp6
-rw-r--r--ui/thumbnaillist.cpp2
-rw-r--r--ui/toc.cpp2
25 files changed, 69 insertions, 62 deletions
diff --git a/active/app/src/main.cpp b/active/app/src/main.cpp
index 8d1c62c..004f12c 100644
--- a/active/app/src/main.cpp
+++ b/active/app/src/main.cpp
@@ -51,7 +51,8 @@ int main(int argc, char **argv)
KCmdLineArgs *args = KCmdLineArgs::parsedArgs();
- KGlobal::locale()->insertCatalog("org.kde.okular");
+ //KF5 port: remove this line and define TRANSLATION_DOMAIN in CMakeLists.txt instead
+//KLocale::global()->insertCatalog("org.kde.okular");
//kDebug() << "ARGS:" << args << args->count();
KDeclarativeMainWindow *mainWindow = new KDeclarativeMainWindow();
diff --git a/active/components/okularplugin.cpp b/active/components/okularplugin.cpp
index 2193945..a7cbff1 100644
--- a/active/components/okularplugin.cpp
+++ b/active/components/okularplugin.cpp
@@ -32,7 +32,8 @@
void OkularPlugin::registerTypes(const char *uri)
{
Q_ASSERT(uri == QLatin1String("org.kde.okular"));
- KGlobal::locale()->insertCatalog("org.kde.okular");
+ //KF5 port: remove this line and define TRANSLATION_DOMAIN in CMakeLists.txt instead
+//KLocale::global()->insertCatalog("org.kde.okular");
qmlRegisterType<DocumentItem>(uri, 0, 1, "DocumentItem");
qmlRegisterType<PageItem>(uri, 0, 1, "PageItem");
qmlRegisterType<ThumbnailItem>(uri, 0, 1, "ThumbnailItem");
diff --git a/core/document.cpp b/core/document.cpp
index 55fc739..028b108 100644
--- a/core/document.cpp
+++ b/core/document.cpp
@@ -89,6 +89,7 @@
#include <memory>
#include <config-okular.h>
+#include <KFormat>
using namespace Okular;
@@ -279,7 +280,7 @@ QString DocumentPrivate::localizedSize(const QSizeF &size) const
case Generator::None:
break;
}
- if (KGlobal::locale()->measureSystem() == KLocale::Imperial)
+ if (KLocale::global()->measureSystem() == KLocale::Imperial)
{
return i18nc("%1 is width, %2 is height, %3 is paper size name", "%1 x %2 in (%3)", inchesWidth, inchesHeight, namePaperSize(inchesWidth, inchesHeight));
}
@@ -934,7 +935,8 @@ Document::OpenResult DocumentPrivate::openDocumentInternal( const KService::Ptr&
Q_ASSERT_X( m_generator, "Document::load()", "null generator?!" );
if ( !catalogName.isEmpty() )
- KGlobal::locale()->insertCatalog( catalogName );
+ //KF5 port: remove this line and define TRANSLATION_DOMAIN in CMakeLists.txt instead
+//KLocale::global()->insertCatalog( catalogName );
m_generator->d_func()->m_document = this;
@@ -983,7 +985,7 @@ Document::OpenResult DocumentPrivate::openDocumentInternal( const KService::Ptr&
{
#pragma message("KF5: FIXME load translations")
// if ( !catalogName.isEmpty() )
-// KGlobal::locale()->removeCatalog( catalogName );
+// KLocale::global()->removeCatalog( catalogName );
m_generator->d_func()->m_document = 0;
QObject::disconnect( m_generator, 0, m_parent, 0 );
@@ -2431,7 +2433,7 @@ void Document::closeDocument()
Q_ASSERT( genIt != d->m_loadedGenerators.constEnd() );
#pragma message("KF5: FIXME load translations")
// if ( !genIt.value().catalogName.isEmpty() && !genIt.value().config )
-// KGlobal::locale()->removeCatalog( genIt.value().catalogName );
+// KLocale::global()->removeCatalog( genIt.value().catalogName );
}
d->m_generator = 0;
d->m_generatorName = QString();
@@ -2619,7 +2621,7 @@ DocumentInfo Document::documentInfo( const QSet<DocumentInfo::Key> &keys ) const
if ( d->m_docSize != -1 && missingKeys.contains( DocumentInfo::DocumentSize ) )
{
- const QString sizeString = KGlobal::locale()->formatByteSize( d->m_docSize );
+ const QString sizeString = KFormat().formatByteSize( d->m_docSize );
info.set( DocumentInfo::DocumentSize, sizeString );
}
if ( missingKeys.contains( DocumentInfo::PagesSize ) )
@@ -3985,8 +3987,10 @@ void Document::fillConfigDialog( KConfigDialog * dialog )
{
iface->addPages( dialog );
pagesAdded = true;
- if ( !it.value().catalogName.isEmpty() )
- KGlobal::locale()->insertCatalog( it.value().catalogName );
+ if ( !it.value().catalogName.isEmpty() ) {
+ //KF5 port: remove this line and define TRANSLATION_DOMAIN in CMakeLists.txt instead
+ //KLocale::global()->insertCatalog( it.value().catalogName );
+ }
}
}
if ( pagesAdded )
diff --git a/core/script/kjs_app.cpp b/core/script/kjs_app.cpp
index ea79393..ab55fa4 100644
--- a/core/script/kjs_app.cpp
+++ b/core/script/kjs_app.cpp
@@ -56,7 +56,7 @@ static KJSObject appGetLanguage( KJSContext *, void * )
QString lang;
QString country;
QString dummy;
- KLocale::splitLocale( KGlobal::locale()->language(),
+ KLocale::splitLocale( KLocale::global()->language(),
lang, country, dummy, dummy );
QString acroLang = QString::fromLatin1( "ENU" );
if ( lang == QLatin1String( "da" ) )
diff --git a/generators/chm/generator_chm.cpp b/generators/chm/generator_chm.cpp
index c1dc5b8..9384ca5 100644
--- a/generators/chm/generator_chm.cpp
+++ b/generators/chm/generator_chm.cpp
@@ -56,7 +56,7 @@ static QString absolutePath( const QString &baseUrl, const QString &path )
}
else
{
- KUrl url = KUrl::fromPath( baseUrl );
+ KUrl url = QUrl::fromLocalFile( baseUrl );
url.setFileName( path );
absPath = url.toLocalFile();
}
diff --git a/generators/dvi/pageSize.cpp b/generators/dvi/pageSize.cpp
index f7b855e..3a98e29 100644
--- a/generators/dvi/pageSize.cpp
+++ b/generators/dvi/pageSize.cpp
@@ -209,7 +209,7 @@ QString pageSize::preferredUnit() const
return staticList[currentSize].preferredUnit;
// User-defined size. Give a preferred unit depening on the locale.
- if (KGlobal::locale()-> measureSystem() == KLocale::Metric)
+ if (KLocale::global()-> measureSystem() == KLocale::Metric)
return "mm";
else
return "in";
@@ -314,7 +314,7 @@ QString pageSize::description() const
QString size = " ";
if (formatNumber() == -1) {
- if (KGlobal::locale()-> measureSystem() == KLocale::Metric)
+ if (KLocale::global()-> measureSystem() == KLocale::Metric)
size += QString("%1x%2 mm").arg(width().getLength_in_mm(), 0, 'f', 0).arg(height().getLength_in_mm(), 0, 'f', 0);
else
size += QString("%1x%2 in").arg(width().getLength_in_inch(), 0, 'g', 2).arg(height().getLength_in_inch(), 0, 'g', 2);
@@ -351,10 +351,10 @@ void pageSize::reconstructCurrentSize()
int pageSize::defaultPageSize()
{
- // FIXME: static_cast<QPrinter::PageSize>(KGlobal::locale()->pageSize())
+ // FIXME: static_cast<QPrinter::PageSize>(KLocale::global()->pageSize())
// is the proper solution here. Then you can determine the values
// without using your hardcoded table too!
- if (KGlobal::locale()-> measureSystem() == KLocale::Metric)
+ if (KLocale::global()-> measureSystem() == KLocale::Metric)
return defaultMetricPaperSize;
else
return defaultImperialPaperSize;
diff --git a/generators/epub/epubdocument.cpp b/generators/epub/epubdocument.cpp
index 02c59f0..4a66616 100644
--- a/generators/epub/epubdocument.cpp
+++ b/generators/epub/epubdocument.cpp
@@ -57,7 +57,7 @@ struct epub *EpubDocument::getEpub()
void EpubDocument::setCurrentSubDocument(const QString &doc)
{
- mCurrentSubDocument = KUrl::fromPath("/" + doc);
+ mCurrentSubDocument = QUrl::fromLocalFile("/" + doc);
}
int EpubDocument::maxContentHeight() const
diff --git a/generators/fictionbook/converter.cpp b/generators/fictionbook/converter.cpp
index 9f3ec26..39517ec 100644
--- a/generators/fictionbook/converter.cpp
+++ b/generators/fictionbook/converter.cpp
@@ -189,7 +189,7 @@ QTextDocument* Converter::convert( const QString &fileName )
if ( mDocumentInfo->mDate.isValid() )
emit addMetaData( Okular::DocumentInfo::CreationDate,
- KGlobal::locale()->formatDate( mDocumentInfo->mDate, KLocale::ShortDate ) );
+ KLocale::global()->formatDate( mDocumentInfo->mDate, KLocale::ShortDate ) );
}
QMapIterator<QString, QPair<int, int> > it( mLocalLinks );
diff --git a/generators/ooo/styleparser.cpp b/generators/ooo/styleparser.cpp
index 220b121..2795306 100644
--- a/generators/ooo/styleparser.cpp
+++ b/generators/ooo/styleparser.cpp
@@ -136,7 +136,7 @@ bool StyleParser::parseMetaFile()
mStyleInformation->addMetaInformation( "producer", child.text(), i18n( "Producer" ) );
} else if ( child.tagName() == QLatin1String( "creation-date" ) ) {
const QDateTime dateTime = QDateTime::fromString( child.text(), Qt::ISODate );
- mStyleInformation->addMetaInformation( "creationDate", KGlobal::locale()->formatDateTime( dateTime, KLocale::LongDate, true ),
+ mStyleInformation->addMetaInformation( "creationDate", KLocale::global()->formatDateTime( dateTime, KLocale::LongDate, true ),
i18n( "Created" ) );
} else if ( child.tagName() == QLatin1String( "initial-creator" ) ) {
mStyleInformation->addMetaInformation( "creator", child.text(), i18n( "Creator" ) );
@@ -144,7 +144,7 @@ bool StyleParser::parseMetaFile()
mStyleInformation->addMetaInformation( "author", child.text(), i18n( "Author" ) );
} else if ( child.tagName() == QLatin1String( "date" ) ) {
const QDateTime dateTime = QDateTime::fromString( child.text(), Qt::ISODate );
- mStyleInformation->addMetaInformation( "modificationDate", KGlobal::locale()->formatDateTime( dateTime, KLocale::LongDate, true ),
+ mStyleInformation->addMetaInformation( "modificationDate", KLocale::global()->formatDateTime( dateTime, KLocale::LongDate, true ),
i18n( "Modified" ) );
}
diff --git a/generators/poppler/generator_pdf.cpp b/generators/poppler/generator_pdf.cpp
index 073f61b..1a1eeef 100644
--- a/generators/poppler/generator_pdf.cpp
+++ b/generators/poppler/generator_pdf.cpp
@@ -620,9 +620,9 @@ Okular::DocumentInfo PDFGenerator::generateDocumentInfo( const QSet<Okular::Docu
if ( keys.contains( Okular::DocumentInfo::Producer ) )
docInfo.set( Okular::DocumentInfo::Producer, pdfdoc->info("Producer") );
if ( keys.contains( Okular::DocumentInfo::CreationDate ) )
- docInfo.set( Okular::DocumentInfo::CreationDate, KGlobal::locale()->formatDateTime( pdfdoc->date("CreationDate"), KLocale::LongDate, true ) );
+ docInfo.set( Okular::DocumentInfo::CreationDate, KLocale::global()->formatDateTime( pdfdoc->date("CreationDate"), KLocale::LongDate, true ) );
if ( keys.contains( Okular::DocumentInfo::ModificationDate ) )
- docInfo.set( Okular::DocumentInfo::ModificationDate, KGlobal::locale()->formatDateTime( pdfdoc->date("ModDate"), KLocale::LongDate, true ) );
+ docInfo.set( Okular::DocumentInfo::ModificationDate, KLocale::global()->formatDateTime( pdfdoc->date("ModDate"), KLocale::LongDate, true ) );
if ( keys.contains( Okular::DocumentInfo::CustomKeys ) )
{
int major, minor;
diff --git a/generators/tiff/generator_tiff.cpp b/generators/tiff/generator_tiff.cpp
index cb1206a..ba57d6d 100644
--- a/generators/tiff/generator_tiff.cpp
+++ b/generators/tiff/generator_tiff.cpp
@@ -341,7 +341,7 @@ Okular::DocumentInfo TIFFGenerator::generateDocumentInfo( const QSet<Okular::Doc
char* buffer = 0;
TIFFGetField( d->tiff, TIFFTAG_DATETIME, &buffer );
QDateTime date = convertTIFFDateTime( buffer );
- docInfo.set( Okular::DocumentInfo::CreationDate, date.isValid() ? KGlobal::locale()->formatDateTime( date, KLocale::LongDate, true ) : QString() );
+ docInfo.set( Okular::DocumentInfo::CreationDate, date.isValid() ? KLocale::global()->formatDateTime( date, KLocale::LongDate, true ) : QString() );
}
}
diff --git a/generators/xps/generator_xps.cpp b/generators/xps/generator_xps.cpp
index 9acf3a4..c114408 100644
--- a/generators/xps/generator_xps.cpp
+++ b/generators/xps/generator_xps.cpp
@@ -494,7 +494,7 @@ static QString absolutePath( const QString &path, const QString &location )
// already absolute
retPath = location;
} else {
- KUrl url = KUrl::fromPath( path );
+ KUrl url = QUrl::fromLocalFile( path );
url.setFileName( location );
retPath = url.toLocalFile();
}
@@ -2024,10 +2024,10 @@ Okular::DocumentInfo XpsFile::generateDocumentInfo() const
docInfo.set( Okular::DocumentInfo::Category, xml.readElementText() );
} else if (xml.name() == "created") {
QDateTime createdDate = QDateTime::fromString( xml.readElementText(), "yyyy-MM-ddThh:mm:ssZ" );
- docInfo.set( Okular::DocumentInfo::CreationDate, KGlobal::locale()->formatDateTime( createdDate, KLocale::LongDate, true ) );
+ docInfo.set( Okular::DocumentInfo::CreationDate, KLocale::global()->formatDateTime( createdDate, KLocale::LongDate, true ) );
} else if (xml.name() == "modified") {
QDateTime modifiedDate = QDateTime::fromString( xml.readElementText(), "yyyy-MM-ddThh:mm:ssZ" );
- docInfo.set( Okular::DocumentInfo::ModificationDate, KGlobal::locale()->formatDateTime( modifiedDate, KLocale::LongDate, true ) );
+ docInfo.set( Okular::DocumentInfo::ModificationDate, KLocale::global()->formatDateTime( modifiedDate, KLocale::LongDate, true ) );
} else if (xml.name() == "keywords") {
docInfo.set( Okular::DocumentInfo::Keywords, xml.readElementText() );
} else if (xml.name() == "revision") {
diff --git a/part.cpp b/part.cpp
index eae7149..920a996 100644
--- a/part.cpp
+++ b/part.cpp
@@ -508,7 +508,7 @@ m_cliPresentation(false), m_cliPrint(false), m_embedMode(detectEmbedMode(parentW
// [SPEECH] check for KTTSD presence and usability
const KService::Ptr kttsd = KService::serviceByDesktopName("kttsd");
Okular::Settings::setUseKTTSD( kttsd );
- Okular::Settings::self()->writeConfig();
+ Okular::Settings::self()->save();
rebuildBookmarkMenu( false );
@@ -1642,7 +1642,7 @@ void Part::slotShowLeftPanel()
{
bool showLeft = m_showLeftPanel->isChecked();
Okular::Settings::setShowLeftPanel( showLeft );
- Okular::Settings::self()->writeConfig();
+ Okular::Settings::self()->save();
// show/hide left panel
m_sidebar->setSidebarVisibility( showLeft );
}
@@ -1651,7 +1651,7 @@ void Part::slotShowBottomBar()
{
const bool showBottom = m_showBottomBar->isChecked();
Okular::Settings::setShowBottomBar( showBottom );
- Okular::Settings::self()->writeConfig();
+ Okular::Settings::self()->save();
// show/hide bottom bar
m_bottomBar->setVisible( showBottom );
}
@@ -2258,7 +2258,7 @@ void Part::slotSaveCopyAs()
{
// make use of the already downloaded (in case of remote URLs) file,
// no point in downloading that again
- KUrl srcUrl = KUrl::fromPath( localFilePath() );
+ KUrl srcUrl = QUrl::fromLocalFile( localFilePath() );
QTemporaryFile * tempFile = 0;
// duh, our local file disappeared...
if ( !QFile::exists( localFilePath() ) )
@@ -2268,7 +2268,7 @@ void Part::slotSaveCopyAs()
#ifdef OKULAR_KEEP_FILE_OPEN
// local file: try to get it back from the open handle on it
if ( ( tempFile = m_keeper->copyToTemporary() ) )
- srcUrl = KUrl::fromPath( tempFile->fileName() );
+ srcUrl = QUrl::fromLocalFile( tempFile->fileName() );
#else
const QString msg = i18n( "Okular cannot copy %1 to the specified location.\n\nThe document does not exist anymore.", localFilePath() );
KMessageBox::sorry( widget(), msg );
diff --git a/ui/annotationpropertiesdialog.cpp b/ui/annotationpropertiesdialog.cpp
index 7a77e22..412503d 100644
--- a/ui/annotationpropertiesdialog.cpp
+++ b/ui/annotationpropertiesdialog.cpp
@@ -71,12 +71,12 @@ AnnotsPropertiesDialog::AnnotsPropertiesDialog( QWidget *parent, Okular::Documen
gridlayout->addWidget( AuthorEdit, 0, 1 );
tmplabel = new QLabel( page );
- tmplabel->setText( i18n( "Created: %1", KGlobal::locale()->formatDateTime( ann->creationDate(), KLocale::LongDate, true ) ) );
+ tmplabel->setText( i18n( "Created: %1", KLocale::global()->formatDateTime( ann->creationDate(), KLocale::LongDate, true ) ) );
tmplabel->setTextInteractionFlags( Qt::TextSelectableByMouse );
gridlayout->addWidget( tmplabel, 1, 0, 1, 2 );
m_modifyDateLabel = new QLabel( page );
- m_modifyDateLabel->setText( i18n( "Modified: %1", KGlobal::locale()->formatDateTime( ann->modificationDate(), KLocale::LongDate, true ) ) );
+ m_modifyDateLabel->setText( i18n( "Modified: %1", KLocale::global()->formatDateTime( ann->modificationDate(), KLocale::LongDate, true ) ) );
m_modifyDateLabel->setTextInteractionFlags( Qt::TextSelectableByMouse );
gridlayout->addWidget( m_modifyDateLabel, 2, 0, 1, 2 );
@@ -176,7 +176,7 @@ void AnnotsPropertiesDialog::slotapply()
m_document->modifyPageAnnotationProperties( m_page, m_annot );
- m_modifyDateLabel->setText( i18n( "Modified: %1", KGlobal::locale()->formatDateTime( m_annot->modificationDate(), KLocale::LongDate, true ) ) );
+ m_modifyDateLabel->setText( i18n( "Modified: %1", KLocale::global()->formatDateTime( m_annot->modificationDate(), KLocale::LongDate, true ) ) );
modified = false;
button( QDialogButtonBox::Apply )->setEnabled( false );
diff --git a/ui/annotwindow.cpp b/ui/annotwindow.cpp
index afd84ae..a58387a 100644
--- a/ui/annotwindow.cpp
+++ b/ui/annotwindow.cpp
@@ -156,7 +156,7 @@ public:
void setDate( const QDateTime& dt )
{
- dateLabel->setText( KGlobal::locale()->formatDateTime( dt, KLocale::ShortDate, true ) + ' ' );
+ dateLabel->setText( KLocale::global()->formatDateTime( dt, KLocale::ShortDate, true ) + ' ' );
}
void setAuthor( const QString& author )
diff --git a/ui/embeddedfilesdialog.cpp b/ui/embeddedfilesdialog.cpp
index 627e80e..34bd637 100644
--- a/ui/embeddedfilesdialog.cpp
+++ b/ui/embeddedfilesdialog.cpp
@@ -21,6 +21,7 @@
#include <QMimeType>
#include <QMimeDatabase>
#include <kstandardguiitem.h>
+#include <KFormat>
#include "core/document.h"
#include "guiutils.h"
@@ -32,7 +33,7 @@ static const int EmbeddedFileRole = Qt::UserRole + 100;
static QString dateToString( const QDateTime & date )
{
return date.isValid()
- ? KGlobal::locale()->formatDateTime( date, KLocale::LongDate, true )
+ ? KLocale::global()->formatDateTime( date, KLocale::LongDate, true )
: i18nc( "Unknown date", "Unknown" );
}
@@ -68,7 +69,7 @@ EmbeddedFilesDialog::EmbeddedFilesDialog(QWidget *parent, const Okular::Document
twi->setIcon(0, QIcon::fromTheme(mime.iconName()));
}
twi->setText(1, ef->description());
- twi->setText(2, ef->size() <= 0 ? i18nc("Not available size", "N/A") : KGlobal::locale()->formatByteSize(ef->size()));
+ twi->setText(2, ef->size() <= 0 ? i18nc("Not available size", "N/A") : KFormat().formatByteSize(ef->size()));
twi->setText(3, dateToString( ef->creationDate() ) );
twi->setText(4, dateToString( ef->modificationDate() ) );
twi->setData( 0, EmbeddedFileRole, qVariantFromValue( ef ) );
diff --git a/ui/findbar.cpp b/ui/findbar.cpp
index 53d78da..9e93f0e 100644
--- a/ui/findbar.cpp
+++ b/ui/findbar.cpp
@@ -160,7 +160,7 @@ void FindBar::caseSensitivityChanged()
if ( !m_active )
return;
Okular::Settings::setSearchCaseSensitive( m_caseSensitiveAct->isChecked() );
- Okular::Settings::self()->writeConfig();
+ Okular::Settings::self()->save();
m_search->lineEdit()->restartSearch();
}
@@ -170,7 +170,7 @@ void FindBar::fromCurrentPageChanged()
if ( !m_active )
return;
Okular::Settings::setSearchFromCurrentPage( m_fromCurrentPageAct->isChecked() );
- Okular::Settings::self()->writeConfig();
+ Okular::Settings::self()->save();
}
void FindBar::closeAndStopSearch()
diff --git a/ui/guiutils.cpp b/ui/guiutils.cpp
index aa12c21..fc8dc78 100644
--- a/ui/guiutils.cpp
+++ b/ui/guiutils.cpp
@@ -138,7 +138,7 @@ QString authorForAnnotation( const Okular::Annotation * ann )
QString contentsHtml( const Okular::Annotation * ann )
{
- QString text = Qt::escape( ann->contents() );
+ QString text = ann->contents().toHtmlEscaped();
text.replace( '\n', "<br>" );
return text;
}
diff --git a/ui/latexrenderer.cpp b/ui/latexrenderer.cpp
index 32c03fb..c36d799 100644
--- a/ui/latexrenderer.cpp
+++ b/ui/latexrenderer.cpp
@@ -93,7 +93,7 @@ LatexRenderer::Error LatexRenderer::renderLatexInHtml( QString& html, const QCol
continue;
imagePxWidth = theImage.width();
imagePxHeight = theImage.height();
- QString escapedLATEX=Qt::escape(it.key()).replace('\"',"&quot;"); //we need the escape quotes because that string will be in a title="" argument, but not the \n
+ QString escapedLATEX=it.key().toHtmlEscaped().replace('\"',"&quot;"); //we need the escape quotes because that string will be in a title="" argument, but not the \n
html.replace(it.key(), " <img width=\"" + QString::number(imagePxWidth) + "\" height=\"" + QString::number(imagePxHeight) + "\" align=\"middle\" src=\"" + (*it) + "\" alt=\"" + escapedLATEX +"\" title=\"" + escapedLATEX +"\" /> ");
}
return NoError;
diff --git a/ui/pageview.cpp b/ui/pageview.cpp
index c3014f4..6e88d7f 100644
--- a/ui/pageview.cpp
+++ b/ui/pageview.cpp
@@ -3653,7 +3653,7 @@ void PageView::updateZoom( ZoomMode newZoomMode )
// kdelibs4 sometimes adds accelerators to actions' text directly :(
z.remove ('&');
z.remove ('%');
- newFactor = KGlobal::locale()->readNumber( z ) / 100.0;
+ newFactor = KLocale::global()->readNumber( z ) / 100.0;
}break;
case ZoomIn:
case ZoomOut:{
@@ -3771,10 +3771,10 @@ void PageView::updateZoomText()
if ( !inserted )
selIdx++;
// we do not need to display 2-digit precision
- QString localValue( KGlobal::locale()->formatNumber( value * 100.0, 1 ) );
- localValue.remove( KGlobal::locale()->decimalSymbol() + single_oh );
+ QString localValue( KLocale::global()->formatNumber( value * 100.0, 1 ) );
+ localValue.remove( KLocale::global()->decimalSymbol() + single_oh );
// remove a trailing zero in numbers like 66.70
- if ( localValue.right( 1 ) == QLatin1String( "0" ) && localValue.indexOf( KGlobal::locale()->decimalSymbol() ) > -1 )
+ if ( localValue.right( 1 ) == QLatin1String( "0" ) && localValue.indexOf( KLocale::global()->decimalSymbol() ) > -1 )
localValue.chop( 1 );
translated << QString( "%1%" ).arg( localValue );
}
@@ -4614,7 +4614,7 @@ void PageView::slotViewMode( QAction *action )
if ( (int)Okular::Settings::viewMode() != nr )
{
Okular::Settings::setViewMode( nr );
- Okular::Settings::self()->writeConfig();
+ Okular::Settings::self()->save();
if ( d->document->pages() > 0 )
slotRelayoutPages();
}
@@ -4625,7 +4625,7 @@ void PageView::slotContinuousToggled( bool on )
if ( Okular::Settings::viewContinuous() != on )
{
Okular::Settings::setViewContinuous( on );
- Okular::Settings::self()->writeConfig();
+ Okular::Settings::self()->save();
if ( d->document->pages() > 0 )
slotRelayoutPages();
}
@@ -4641,7 +4641,7 @@ void PageView::slotSetMouseNormal()
d->aToggleAnnotator->trigger();
// force an update of the cursor
updateCursor();
- Okular::Settings::self()->writeConfig();
+ Okular::Settings::self()->save();
}
void PageView::slotSetMouseZoom()
@@ -4657,7 +4657,7 @@ void PageView::slotSetMouseZoom()
}
// force an update of the cursor
updateCursor();
- Okular::Settings::self()->writeConfig();
+ Okular::Settings::self()->save();
}
void PageView::slotSetMouseMagnifier()
@@ -4667,7 +4667,7 @@ void PageView::slotSetMouseMagnifier()
// force an update of the cursor
updateCursor();
- Okular::Settings::self()->writeConfig();
+ Okular::Settings::self()->save();
}
void PageView::slotSetMouseSelect()
@@ -4683,7 +4683,7 @@ void PageView::slotSetMouseSelect()
}
// force an update of the cursor
updateCursor();
- Okular::Settings::self()->writeConfig();
+ Okular::Settings::self()->save();
}
void PageView::slotSetMouseTextSelect()
@@ -4699,7 +4699,7 @@ void PageView::slotSetMouseTextSelect()
}
// force an update of the cursor
updateCursor();
- Okular::Settings::self()->writeConfig();
+ Okular::Settings::self()->save();
}
void PageView::slotSetMouseTableSelect()
@@ -4717,7 +4717,7 @@ void PageView::slotSetMouseTableSelect()
}
// force an update of the cursor
updateCursor();
- Okular::Settings::self()->writeConfig();
+ Okular::Settings::self()->save();
}
void PageView::slotToggleAnnotator( bool on )
@@ -4759,7 +4759,7 @@ void PageView::slotToggleAnnotator( bool on )
}
// save the name
Okular::Settings::setIdentityAuthor( userName );
- Okular::Settings::self()->writeConfig();
+ Okular::Settings::self()->save();
}
// create the annotator object if not present
@@ -4872,7 +4872,7 @@ void PageView::slotTrimMarginsToggled( bool on )
if ( Okular::Settings::trimMargins() != on )
{
Okular::Settings::setTrimMargins( on );
- Okular::Settings::self()->writeConfig();
+ Okular::Settings::self()->save();
if ( d->document->pages() > 0 )
{
slotRelayoutPages();
@@ -5041,7 +5041,7 @@ void PageView::slotProcessRenditionAction( const Okular::RenditionAction *action
void PageView::slotToggleChangeColors()
{
Okular::SettingsCore::setChangeColors( !Okular::SettingsCore::changeColors() );
- Okular::Settings::self()->writeConfig();
+ Okular::Settings::self()->save();
viewport()->update();
}
diff --git a/ui/pageviewannotator.cpp b/ui/pageviewannotator.cpp
index 25858f3..538492f 100644
--- a/ui/pageviewannotator.cpp
+++ b/ui/pageviewannotator.cpp
@@ -1061,7 +1061,7 @@ void PageViewAnnotator::slotToolSelected( int toolID )
void PageViewAnnotator::slotSaveToolbarOrientation( int side )
{
Okular::Settings::setEditToolBarPlacement( (int)side );
- Okular::Settings::self()->writeConfig();
+ Okular::Settings::self()->save();
}
void PageViewAnnotator::slotToolDoubleClicked( int /*toolID*/ )
diff --git a/ui/side_reviews.cpp b/ui/side_reviews.cpp
index 02096a0..2dd2d2a 100644
--- a/ui/side_reviews.cpp
+++ b/ui/side_reviews.cpp
@@ -283,7 +283,7 @@ void Reviews::saveSearchOptions()
{
Okular::Settings::setReviewsSearchRegularExpression( m_searchLine->regularExpression() );
Okular::Settings::setReviewsSearchCaseSensitive( m_searchLine->caseSensitivity() == Qt::CaseSensitive ? true : false );
- Okular::Settings::self()->writeConfig();
+ Okular::Settings::self()->save();
}
#include "moc_side_reviews.cpp"
diff --git a/ui/sidebar.cpp b/ui/sidebar.cpp
index a30d01d..763ecd8 100644
--- a/ui/sidebar.cpp
+++ b/ui/sidebar.cpp
@@ -698,7 +698,7 @@ void Sidebar::splitterMoved( int /*pos*/, int index )
void Sidebar::saveSplitterSize() const
{
Okular::Settings::setSplitterSizes( d->splitter->sizes() );
- Okular::Settings::self()->writeConfig();
+ Okular::Settings::self()->save();
}
void Sidebar::listContextMenu( const QPoint &pos )
@@ -736,7 +736,7 @@ void Sidebar::showTextToggled( bool on )
d->list->reset();
d->list->update();
Okular::Settings::setSidebarShowText( on );
- Okular::Settings::self()->writeConfig();
+ Okular::Settings::self()->save();
}
void Sidebar::iconSizeChanged( QAction *action )
@@ -748,7 +748,7 @@ void Sidebar::iconSizeChanged( QAction *action )
d->list->reset();
d->list->update();
Okular::Settings::setSidebarIconSize( size );
- Okular::Settings::self()->writeConfig();
+ Okular::Settings::self()->save();
}
void Sidebar::appearanceChanged()
diff --git a/ui/thumbnaillist.cpp b/ui/thumbnaillist.cpp
index dc4dd5f..3cf9350 100644
--- a/ui/thumbnaillist.cpp
+++ b/ui/thumbnaillist.cpp
@@ -487,7 +487,7 @@ void ThumbnailList::slotFilterBookmarks( bool filterOn )
{
// save state
Okular::Settings::setFilterBookmarks( filterOn );
- Okular::Settings::self()->writeConfig();
+ Okular::Settings::self()->save();
// ask for the 'notifySetup' with a little trick (on reinsertion the
// document sends the list again)
d->m_document->removeObserver( this );
diff --git a/ui/toc.cpp b/ui/toc.cpp
index e796707..b13345a 100644
--- a/ui/toc.cpp
+++ b/ui/toc.cpp
@@ -172,7 +172,7 @@ void TOC::saveSearchOptions()
{
Okular::Settings::setContentsSearchRegularExpression( m_searchLine->regularExpression() );
Okular::Settings::setContentsSearchCaseSensitive( m_searchLine->caseSensitivity() == Qt::CaseSensitive ? true : false );
- Okular::Settings::self()->writeConfig();
+ Okular::Settings::self()->save();
}
#include "moc_toc.cpp"