From 4b15c535ece57248ebd37cfaef69dfa5c28e6456 Mon Sep 17 00:00:00 2001 From: Craig Watson Date: Fri, 6 Nov 2015 15:18:31 +0100 Subject: [PATCH] minor compatibility updates (added missing headers, simple function name changes etc) --- src/desktop/UBCustomCaptureWindow.cpp | 2 ++ src/desktop/UBCustomCaptureWindow.h | 3 +++ src/desktop/UBWindowCapture_linux.cpp | 1 + src/document/UBDocumentController.h | 1 + src/domain/UBGraphicsWidgetItem.cpp | 4 +++- src/domain/UBUndoCommand.h | 1 + src/frameworks/UBCryptoUtils.cpp | 8 ++++---- src/frameworks/UBPlatformUtils_linux.cpp | 5 +++-- src/gui/UBActionPalette.cpp | 9 ++++++--- src/gui/UBActionPalette.h | 2 ++ src/gui/UBColorPicker.h | 1 + src/gui/UBDockPalette.cpp | 4 ++-- src/gui/UBDocumentTreeWidget.h | 1 + src/gui/UBDownloadWidget.cpp | 4 ++-- src/gui/UBFeaturesActionBar.cpp | 3 ++- src/gui/UBFeaturesActionBar.h | 3 +++ src/gui/UBFeaturesWidget.cpp | 10 ++++++---- src/gui/UBFeaturesWidget.h | 4 ++++ src/gui/UBMagnifer.h | 1 + src/gui/UBMainWindow.cpp | 2 ++ src/gui/UBMessageWindow.h | 2 ++ src/gui/UBMessagesDialog.cpp | 6 ++++-- src/gui/UBMessagesDialog.h | 3 ++- src/gui/UBMousePressFilter.cpp | 2 +- src/gui/UBRubberBand.cpp | 1 - src/gui/UBScreenMirror.cpp | 1 + src/gui/UBScreenMirror.h | 1 + src/gui/UBToolWidget.cpp | 6 +++++- src/gui/UBToolWidget.h | 1 + src/gui/UBToolbarButtonGroup.cpp | 2 ++ src/gui/UBToolbarButtonGroup.h | 4 ++++ src/gui/UBWidgetMirror.h | 1 + src/gui/UBZoomPalette.cpp | 1 + src/network/UBNetworkAccessManager.cpp | 4 +++- src/pdf-merger/Utils.cpp | 4 ++-- src/pdf/GraphicsPDFItem.cpp | 2 +- src/pdf/UBWebPluginPDFWidget.cpp | 1 + src/podcast/UBPodcastController.cpp | 8 ++++---- src/podcast/UBPodcastRecordingPalette.h | 1 + src/tools/UBAbstractDrawRuler.cpp | 2 +- src/tools/UBAbstractDrawRuler.h | 1 + src/tools/UBGraphicsCompass.cpp | 2 +- src/web/UBOEmbedParser.cpp | 3 +-- src/web/UBWebController.cpp | 1 + src/web/UBWebKitUtils.cpp | 1 + src/web/browser/WBBrowserWindow.cpp | 1 + src/web/browser/WBChaseWidget.cpp | 1 + src/web/browser/WBChaseWidget.h | 1 + src/web/browser/WBDownloadManager.cpp | 3 ++- src/web/browser/WBDownloadManager.h | 1 + src/web/browser/WBEditTableView.h | 1 + src/web/browser/WBModelMenu.h | 1 + src/web/browser/WBSearchLineEdit.cpp | 1 + src/web/browser/WBSearchLineEdit.h | 1 + src/web/browser/WBSqueezeLabel.h | 2 +- src/web/browser/WBTabWidget.cpp | 2 ++ src/web/browser/WBTabWidget.h | 8 ++++++++ src/web/browser/WBToolBarSearch.cpp | 13 +++++++++---- src/web/browser/WBUrlLineEdit.cpp | 4 ++++ src/web/browser/WBUrlLineEdit.h | 3 +++ src/web/browser/WBWebTrapWebView.cpp | 2 ++ src/web/browser/WBWebTrapWebView.h | 1 + src/web/browser/WBWebView.cpp | 2 ++ 63 files changed, 135 insertions(+), 43 deletions(-) diff --git a/src/desktop/UBCustomCaptureWindow.cpp b/src/desktop/UBCustomCaptureWindow.cpp index cac54f37..f625c56a 100644 --- a/src/desktop/UBCustomCaptureWindow.cpp +++ b/src/desktop/UBCustomCaptureWindow.cpp @@ -24,6 +24,8 @@ +#include +#include #include "UBCustomCaptureWindow.h" diff --git a/src/desktop/UBCustomCaptureWindow.h b/src/desktop/UBCustomCaptureWindow.h index 385b3ede..af0c8b63 100644 --- a/src/desktop/UBCustomCaptureWindow.h +++ b/src/desktop/UBCustomCaptureWindow.h @@ -29,6 +29,9 @@ #define UBCUSTOMCAPTUREWINDOW_H_ #include +#include +#include + /** * This class is used to do the custom capture of Uninotes **/ diff --git a/src/desktop/UBWindowCapture_linux.cpp b/src/desktop/UBWindowCapture_linux.cpp index b360ebfe..bc84b2ac 100644 --- a/src/desktop/UBWindowCapture_linux.cpp +++ b/src/desktop/UBWindowCapture_linux.cpp @@ -24,6 +24,7 @@ +#include #include "UBWindowCapture.h" #include "UBDesktopAnnotationController.h" diff --git a/src/document/UBDocumentController.h b/src/document/UBDocumentController.h index 786d2829..7fc70926 100644 --- a/src/document/UBDocumentController.h +++ b/src/document/UBDocumentController.h @@ -29,6 +29,7 @@ #define UBDOCUMENTCONTROLLER_H_ #include +#include #include "document/UBDocumentContainer.h" namespace Ui diff --git a/src/domain/UBGraphicsWidgetItem.cpp b/src/domain/UBGraphicsWidgetItem.cpp index 5beead86..9ec12d59 100644 --- a/src/domain/UBGraphicsWidgetItem.cpp +++ b/src/domain/UBGraphicsWidgetItem.cpp @@ -27,6 +27,7 @@ #include #include +#include #include "UBGraphicsWidgetItem.h" #include "UBGraphicsScene.h" @@ -121,7 +122,8 @@ void UBGraphicsWidgetItem::initialize() page()->setPalette(palette); page()->setLinkDelegationPolicy(QWebPage::DelegateAllLinks); - connect(page()->mainFrame(), SIGNAL(javaScriptWindowObjectCleared()), this, SLOT(javaScriptWindowObjectCleared())); + connect(page()->mainFrame(), &QWebFrame::javaScriptWindowObjectCleared, + this, &UBGraphicsWidgetItem::javaScriptWindowObjectCleared); connect(page(), SIGNAL(geometryChangeRequested(const QRect&)), this, SLOT(geometryChangeRequested(const QRect&))); connect(this, SIGNAL(loadFinished(bool)), this, SLOT(mainFrameLoadFinished (bool))); connect(page()->mainFrame(), SIGNAL(initialLayoutCompleted()), this, SLOT(initialLayoutCompleted())); diff --git a/src/domain/UBUndoCommand.h b/src/domain/UBUndoCommand.h index 1d899354..a59e13a4 100644 --- a/src/domain/UBUndoCommand.h +++ b/src/domain/UBUndoCommand.h @@ -29,6 +29,7 @@ #define UBABSTRACTUNDOCOMMAND_H_ #include +#include #include class UBUndoCommand : public QUndoCommand diff --git a/src/frameworks/UBCryptoUtils.cpp b/src/frameworks/UBCryptoUtils.cpp index 214ad72f..f35d0f2c 100644 --- a/src/frameworks/UBCryptoUtils.cpp +++ b/src/frameworks/UBCryptoUtils.cpp @@ -92,13 +92,13 @@ QString UBCryptoUtils::symetricEncrypt(const QString& clear) free(ciphertext); - return QString::fromAscii(cipheredData.toBase64()); + return QString::fromLatin1(cipheredData.toBase64()); } QString UBCryptoUtils::symetricDecrypt(const QString& encrypted) { - QByteArray encryptedData = QByteArray::fromBase64(encrypted.toAscii()); + QByteArray encryptedData = QByteArray::fromBase64(encrypted.toLatin1()); int encryptedLength = encryptedData.length(); int paddingLength = 0; @@ -132,10 +132,10 @@ void UBCryptoUtils::aesInit() { int i, nrounds = 5; unsigned char key[32], iv[32]; - unsigned char *key_data = (unsigned char *)sAESKey.toAscii().data(); + unsigned char *key_data = (unsigned char *)sAESKey.toLatin1().data(); int key_data_len = sAESKey.length(); - i = EVP_BytesToKey(EVP_aes_256_cbc(), EVP_sha1(), (unsigned char *)sAESSalt.toAscii().data(), key_data, + i = EVP_BytesToKey(EVP_aes_256_cbc(), EVP_sha1(), (unsigned char *)sAESSalt.toLatin1().data(), key_data, key_data_len, nrounds, key, iv); if (i != 32) diff --git a/src/frameworks/UBPlatformUtils_linux.cpp b/src/frameworks/UBPlatformUtils_linux.cpp index 5def77c3..73e901a0 100644 --- a/src/frameworks/UBPlatformUtils_linux.cpp +++ b/src/frameworks/UBPlatformUtils_linux.cpp @@ -28,6 +28,7 @@ #include "UBPlatformUtils.h" #include +#include #include #include @@ -98,7 +99,7 @@ void UBPlatformUtils::bringPreviousProcessToFront() QString UBPlatformUtils::osUserLoginName() { char *user = getenv("USER"); - return QString::fromAscii(user); + return QString::fromLatin1(user); } QString UBPlatformUtils::computerName() @@ -108,7 +109,7 @@ QString UBPlatformUtils::computerName() // if the name is longer than 255 the name is truncated but os doesn't ensure // that the last character returned is a null character if(!gethostname(hostname,255)) - return QString::fromAscii(hostname); + return QString::fromLatin1(hostname); else return "NOT FOUND"; } diff --git a/src/gui/UBActionPalette.cpp b/src/gui/UBActionPalette.cpp index b636cd5a..2eb69dae 100644 --- a/src/gui/UBActionPalette.cpp +++ b/src/gui/UBActionPalette.cpp @@ -23,7 +23,8 @@ */ - +#include +#include #include "UBActionPalette.h" @@ -103,8 +104,10 @@ UBActionPaletteButton* UBActionPalette::createPaletteButton(QAction* action, QWi mMapActionToButton[action] = button; - connect(button, SIGNAL(clicked()), this, SLOT(buttonClicked())); - connect(action, SIGNAL(changed()), this, SLOT(actionChanged())); + connect(button, &UBActionPaletteButton::clicked, + this, &UBActionPalette::buttonClicked); + connect(action, &QAction::changed, + this, &UBActionPalette::actionChanged); return button; } diff --git a/src/gui/UBActionPalette.h b/src/gui/UBActionPalette.h index fb909f5a..ed18d602 100644 --- a/src/gui/UBActionPalette.h +++ b/src/gui/UBActionPalette.h @@ -31,6 +31,8 @@ #include #include #include +#include + #include "UBFloatingPalette.h" class UBActionPaletteButton; diff --git a/src/gui/UBColorPicker.h b/src/gui/UBColorPicker.h index 157e863e..d8894cc4 100644 --- a/src/gui/UBColorPicker.h +++ b/src/gui/UBColorPicker.h @@ -29,6 +29,7 @@ #define UBCOLORPICKER_H_ #include +#include class UBColorPicker : public QFrame { diff --git a/src/gui/UBDockPalette.cpp b/src/gui/UBDockPalette.cpp index ea17d00d..f8bfbc1d 100644 --- a/src/gui/UBDockPalette.cpp +++ b/src/gui/UBDockPalette.cpp @@ -654,9 +654,9 @@ void UBTabDockPalette::paintEvent(QPaintEvent *) } painter.save(); - QPixmap transparencyPix(":/images/tab_mask.png"); + //QPixmap transparencyPix(":/images/tab_mask.png"); if (dock->mCurrentTab != i) { - iconPixmap.setAlphaChannel(transparencyPix); + //iconPixmap.setAlphaChannel(transparencyPix); // deprecated; removed for now, to be re-implemented QColor color(0x7F, 0x7F, 0x7F, 0x3F); painter.setBrush(QBrush(color)); } diff --git a/src/gui/UBDocumentTreeWidget.h b/src/gui/UBDocumentTreeWidget.h index 2f336307..af78fe56 100644 --- a/src/gui/UBDocumentTreeWidget.h +++ b/src/gui/UBDocumentTreeWidget.h @@ -29,6 +29,7 @@ #define UBDOCUMENTTREEWIDGET_H_ #include +#include class UBDocumentProxy; class UBDocumentProxyTreeItem; diff --git a/src/gui/UBDownloadWidget.cpp b/src/gui/UBDownloadWidget.cpp index a1f3092f..71c0b695 100644 --- a/src/gui/UBDownloadWidget.cpp +++ b/src/gui/UBDownloadWidget.cpp @@ -61,8 +61,8 @@ UBDownloadWidget::UBDownloadWidget(QWidget *parent, const char *name):QWidget(pa mpTree->setRootIsDecorated(false); mpTree->setColumnCount(2); mpTree->header()->setStretchLastSection(false); - mpTree->header()->setResizeMode(eItemColumn_Desc, QHeaderView::Stretch); - mpTree->header()->setResizeMode(eItemColumn_Close, QHeaderView::Custom); + mpTree->header()->setSectionResizeMode(eItemColumn_Desc, QHeaderView::Stretch); + mpTree->header()->setSectionResizeMode(eItemColumn_Close, QHeaderView::Custom); mpTree->resizeColumnToContents(eItemColumn_Close); mpTree->header()->close(); mpLayout->addWidget(mpTree, 1); diff --git a/src/gui/UBFeaturesActionBar.cpp b/src/gui/UBFeaturesActionBar.cpp index c59ac6b2..3ffec315 100644 --- a/src/gui/UBFeaturesActionBar.cpp +++ b/src/gui/UBFeaturesActionBar.cpp @@ -23,7 +23,8 @@ */ - +#include +#include #include "UBFeaturesActionBar.h" #include "core/memcheck.h" diff --git a/src/gui/UBFeaturesActionBar.h b/src/gui/UBFeaturesActionBar.h index 409b5963..c27cbf89 100644 --- a/src/gui/UBFeaturesActionBar.h +++ b/src/gui/UBFeaturesActionBar.h @@ -31,6 +31,9 @@ #include #include #include +#include +#include + #include "board/UBFeaturesController.h" #define BUTTON_SIZE 24 diff --git a/src/gui/UBFeaturesWidget.cpp b/src/gui/UBFeaturesWidget.cpp index 8c791061..23c5f162 100644 --- a/src/gui/UBFeaturesWidget.cpp +++ b/src/gui/UBFeaturesWidget.cpp @@ -27,6 +27,8 @@ #include #include +#include +#include #include "UBFeaturesWidget.h" #include "gui/UBThumbnailWidget.h" @@ -267,8 +269,8 @@ void UBFeaturesWidget::onDisplayMetadata( QMap metadata ) { QString previewImageUrl = ":images/libpalette/notFound.png"; - QString widgetsUrl = QUrl::fromEncoded(metadata["Url"].toAscii()).toString()/*metadata.value("Url", QString())*/; - QString widgetsThumbsUrl = QUrl::fromEncoded(metadata["thumbnailUrl"].toAscii()).toString(); + QString widgetsUrl = QUrl::fromEncoded(metadata["Url"].toLatin1()).toString()/*metadata.value("Url", QString())*/; + QString widgetsThumbsUrl = QUrl::fromEncoded(metadata["thumbnailUrl"].toLatin1()).toString(); QString strType = UBFileSystemUtils::mimeTypeFromFileName(widgetsUrl); UBMimeType::Enum thumbType = UBFileSystemUtils::mimeTypeFromString(strType); @@ -440,7 +442,7 @@ void UBFeaturesListView::dragMoveEvent( QDragMoveEvent *event ) void UBFeaturesListView::dropEvent( QDropEvent *event ) { - QWidget *eventSource = event->source(); + QObject *eventSource = event->source(); if (eventSource && eventSource->objectName() == UBFeaturesWidget::objNameFeatureList) { event->setDropAction( Qt::MoveAction ); } @@ -1172,7 +1174,7 @@ QMimeData* UBFeaturesModel::mimeData(const QModelIndexList &indexes) const if (!typeData.isNull()) { typeData += UBFeaturesController::featureTypeSplitter(); } - typeData += QString::number(element.getType()).toAscii(); + typeData += QString::number(element.getType()).toLatin1(); } } diff --git a/src/gui/UBFeaturesWidget.h b/src/gui/UBFeaturesWidget.h index 23e9700a..f9f67a47 100644 --- a/src/gui/UBFeaturesWidget.h +++ b/src/gui/UBFeaturesWidget.h @@ -41,6 +41,10 @@ #include #include #include +#include +#include +#include +#include #include "UBDockPaletteWidget.h" #include "core/UBSettings.h" diff --git a/src/gui/UBMagnifer.h b/src/gui/UBMagnifer.h index fcc13a8b..0e942605 100644 --- a/src/gui/UBMagnifer.h +++ b/src/gui/UBMagnifer.h @@ -29,6 +29,7 @@ #define UBMAGNIFIER_H #include +#include class UBMagnifierParams { diff --git a/src/gui/UBMainWindow.cpp b/src/gui/UBMainWindow.cpp index 93292c26..ccfee339 100644 --- a/src/gui/UBMainWindow.cpp +++ b/src/gui/UBMainWindow.cpp @@ -26,6 +26,8 @@ #include +#include +#include #include "UBMainWindow.h" #include "core/UBApplication.h" diff --git a/src/gui/UBMessageWindow.h b/src/gui/UBMessageWindow.h index 68e1825d..db3dc895 100644 --- a/src/gui/UBMessageWindow.h +++ b/src/gui/UBMessageWindow.h @@ -29,6 +29,8 @@ #define UBMESSAGEWINDOW_H_ #include +#include +#include #include "UBFloatingPalette.h" diff --git a/src/gui/UBMessagesDialog.cpp b/src/gui/UBMessagesDialog.cpp index cfd26307..45c458f9 100644 --- a/src/gui/UBMessagesDialog.cpp +++ b/src/gui/UBMessagesDialog.cpp @@ -23,7 +23,9 @@ */ - +#include +#include +#include #include "UBMessagesDialog.h" @@ -65,4 +67,4 @@ void UBMessagesDialog::setMessages(const QList messages) void UBMessagesDialog::dispose() { delete this; -} \ No newline at end of file +} diff --git a/src/gui/UBMessagesDialog.h b/src/gui/UBMessagesDialog.h index ba7e4d2c..4a6197cb 100644 --- a/src/gui/UBMessagesDialog.h +++ b/src/gui/UBMessagesDialog.h @@ -29,6 +29,7 @@ #define UB_MESSAGES_DIALOG_H_ #include +#include class UBMessagesDialog : public QWidget { @@ -46,4 +47,4 @@ private: int mMessagesFontSize; }; -#endif /* UB_MESSAGES_DIALOG_H_ */ \ No newline at end of file +#endif /* UB_MESSAGES_DIALOG_H_ */ diff --git a/src/gui/UBMousePressFilter.cpp b/src/gui/UBMousePressFilter.cpp index 06e5f872..126432a7 100644 --- a/src/gui/UBMousePressFilter.cpp +++ b/src/gui/UBMousePressFilter.cpp @@ -23,7 +23,7 @@ */ - +#include #include "UBMousePressFilter.h" diff --git a/src/gui/UBRubberBand.cpp b/src/gui/UBRubberBand.cpp index d444a735..29e6676d 100644 --- a/src/gui/UBRubberBand.cpp +++ b/src/gui/UBRubberBand.cpp @@ -28,7 +28,6 @@ #include "UBRubberBand.h" #include -#include #include #ifdef Q_WS_MAC diff --git a/src/gui/UBScreenMirror.cpp b/src/gui/UBScreenMirror.cpp index 47f0832d..cf4e7bb8 100644 --- a/src/gui/UBScreenMirror.cpp +++ b/src/gui/UBScreenMirror.cpp @@ -24,6 +24,7 @@ +#include #include "UBScreenMirror.h" diff --git a/src/gui/UBScreenMirror.h b/src/gui/UBScreenMirror.h index a6736d3b..6954d48f 100644 --- a/src/gui/UBScreenMirror.h +++ b/src/gui/UBScreenMirror.h @@ -29,6 +29,7 @@ #define UBSCREENMIRROR_H_ #include +#include class UBScreenMirror : public QWidget { diff --git a/src/gui/UBToolWidget.cpp b/src/gui/UBToolWidget.cpp index 682dddfa..660617d0 100644 --- a/src/gui/UBToolWidget.cpp +++ b/src/gui/UBToolWidget.cpp @@ -26,6 +26,9 @@ #include +#include +#include + #include "UBToolWidget.h" #include "api/UBWidgetUniboardAPI.h" #include "api/UBW3CWidgetAPI.h" @@ -115,7 +118,8 @@ void UBToolWidget::initialize() setFixedSize(mToolWidget->boundingRect().width() + mContentMargin * 2, mToolWidget->boundingRect().height() + mContentMargin * 2); - connect(mWebView->page()->mainFrame(), SIGNAL(javaScriptWindowObjectCleared()), this, SLOT(javaScriptWindowObjectCleared())); + connect(mWebView->page()->mainFrame(), &QWebFrame::javaScriptWindowObjectCleared, + this, &UBToolWidget::javaScriptWindowObjectCleared); mWebView->load(mToolWidget->mainHtml()); diff --git a/src/gui/UBToolWidget.h b/src/gui/UBToolWidget.h index 35f4eb76..56fc5e41 100644 --- a/src/gui/UBToolWidget.h +++ b/src/gui/UBToolWidget.h @@ -29,6 +29,7 @@ #define UBTOOLWIDGET_H_ #include +#include class UBGraphicsWidgetItem; class QWidget; diff --git a/src/gui/UBToolbarButtonGroup.cpp b/src/gui/UBToolbarButtonGroup.cpp index 7c1e85e8..db79e7ac 100644 --- a/src/gui/UBToolbarButtonGroup.cpp +++ b/src/gui/UBToolbarButtonGroup.cpp @@ -28,6 +28,8 @@ #include "UBToolbarButtonGroup.h" #include +#include +#include #include "core/UBApplication.h" #include "core/UBSettings.h" diff --git a/src/gui/UBToolbarButtonGroup.h b/src/gui/UBToolbarButtonGroup.h index 7ba901b3..d802950c 100644 --- a/src/gui/UBToolbarButtonGroup.h +++ b/src/gui/UBToolbarButtonGroup.h @@ -30,6 +30,10 @@ #include +#include +#include +#include +#include class UBToolbarButtonGroup : public QWidget { diff --git a/src/gui/UBWidgetMirror.h b/src/gui/UBWidgetMirror.h index 3916ae3d..6ca2b3d1 100644 --- a/src/gui/UBWidgetMirror.h +++ b/src/gui/UBWidgetMirror.h @@ -29,6 +29,7 @@ #define UBWIDGETMIRROR_H_ #include +#include class UBWidgetMirror : public QWidget { diff --git a/src/gui/UBZoomPalette.cpp b/src/gui/UBZoomPalette.cpp index e380c365..10194113 100644 --- a/src/gui/UBZoomPalette.cpp +++ b/src/gui/UBZoomPalette.cpp @@ -28,6 +28,7 @@ #include "UBZoomPalette.h" #include +#include #include #include "core/UBApplication.h" diff --git a/src/network/UBNetworkAccessManager.cpp b/src/network/UBNetworkAccessManager.cpp index 7e8a4564..87f3a1ea 100644 --- a/src/network/UBNetworkAccessManager.cpp +++ b/src/network/UBNetworkAccessManager.cpp @@ -29,6 +29,8 @@ #include #include +#include +#include #include "core/UBApplication.h" #include "core/UBApplicationController.h" @@ -115,7 +117,7 @@ void UBNetworkAccessManager::authenticationRequired(QNetworkReply *reply, QAuthe passwordDialog.iconLabel->setPixmap(mainWindow->style()->standardIcon(QStyle::SP_MessageBoxQuestion, 0, mainWindow).pixmap(32, 32)); QString introMessage = tr("Enter username and password for \"%1\" at %2"); - introMessage = introMessage.arg(Qt::escape(reply->url().toString())).arg(Qt::escape(reply->url().toString())); + introMessage = introMessage.arg((reply->url().toString()).toHtmlEscaped()).arg((reply->url().toString()).toHtmlEscaped()); passwordDialog.introLabel->setText(introMessage); passwordDialog.introLabel->setWordWrap(true); diff --git a/src/pdf-merger/Utils.cpp b/src/pdf-merger/Utils.cpp index 8e9965c9..c7e75098 100644 --- a/src/pdf-merger/Utils.cpp +++ b/src/pdf-merger/Utils.cpp @@ -78,12 +78,12 @@ double Utils::stringToDouble(const std::string & s ) std::string Utils::uIntToStr(unsigned int integer) { - return std::string(QString::number(integer).toAscii()); + return std::string(QString::number(integer).toLatin1()); } std::string Utils::doubleToStr(double doubleValue) { - return std::string(QString::number(doubleValue).toAscii()); + return std::string(QString::number(doubleValue).toLatin1()); } int Utils::_stringToInt(const std::string & str) //throw ConvertException diff --git a/src/pdf/GraphicsPDFItem.cpp b/src/pdf/GraphicsPDFItem.cpp index 03f97bde..85761898 100644 --- a/src/pdf/GraphicsPDFItem.cpp +++ b/src/pdf/GraphicsPDFItem.cpp @@ -29,7 +29,7 @@ #include -#include +#include #include "core/memcheck.h" diff --git a/src/pdf/UBWebPluginPDFWidget.cpp b/src/pdf/UBWebPluginPDFWidget.cpp index 16274ca2..9dd054e9 100644 --- a/src/pdf/UBWebPluginPDFWidget.cpp +++ b/src/pdf/UBWebPluginPDFWidget.cpp @@ -26,6 +26,7 @@ #include +#include #include "UBWebPluginPDFWidget.h" #include "XPDFRenderer.h" diff --git a/src/podcast/UBPodcastController.cpp b/src/podcast/UBPodcastController.cpp index 0739499b..5ad54ee0 100644 --- a/src/podcast/UBPodcastController.cpp +++ b/src/podcast/UBPodcastController.cpp @@ -487,7 +487,7 @@ void UBPodcastController::processWidgetPaintEvent() { while(mWidgetRepaintRectQueue.size() > 0) { - repaintRect = repaintRect.unite(mWidgetRepaintRectQueue.dequeue()); + repaintRect = repaintRect.united(mWidgetRepaintRectQueue.dequeue()); } } @@ -582,7 +582,7 @@ void UBPodcastController::sceneChanged(const QList & region) QRectF viewportRect = bv->mapToScene(QRect(0, 0, bv->width(), bv->height())).boundingRect(); foreach(const QRectF rect, region) { - QRectF maxRect = rect.intersect(viewportRect); + QRectF maxRect = rect.intersected(viewportRect); mSceneRepaintRectQueue.enqueue(maxRect); } @@ -623,7 +623,7 @@ void UBPodcastController::processScenePaintEvent() { while(mSceneRepaintRectQueue.size() > 0) { - repaintRect = repaintRect.unite(mSceneRepaintRectQueue.dequeue()); + repaintRect = repaintRect.united(mSceneRepaintRectQueue.dequeue()); } } @@ -712,7 +712,7 @@ void UBPodcastController::encodingFinished(bool ok) { QString location; - if (mPodcastRecordingPath == QDesktopServices::storageLocation(QDesktopServices::DesktopLocation)) + if (mPodcastRecordingPath == QStandardPaths::writableLocation(QStandardPaths::DesktopLocation)) location = tr("on your desktop ..."); else { diff --git a/src/podcast/UBPodcastRecordingPalette.h b/src/podcast/UBPodcastRecordingPalette.h index b475c887..bde6d785 100644 --- a/src/podcast/UBPodcastRecordingPalette.h +++ b/src/podcast/UBPodcastRecordingPalette.h @@ -32,6 +32,7 @@ #include "UBPodcastController.h" #include +#include class UBVuMeter; diff --git a/src/tools/UBAbstractDrawRuler.cpp b/src/tools/UBAbstractDrawRuler.cpp index 4db193d0..167d6bca 100644 --- a/src/tools/UBAbstractDrawRuler.cpp +++ b/src/tools/UBAbstractDrawRuler.cpp @@ -69,7 +69,7 @@ void UBAbstractDrawRuler::create(QGraphicsItem& item) item.setFlag(QGraphicsItem::ItemIsSelectable, true); item.setFlag(QGraphicsItem::ItemSendsGeometryChanges, true); - item.setAcceptsHoverEvents(true); + item.setAcceptHoverEvents(true); mCloseSvgItem = new QGraphicsSvgItem(":/images/closeTool.svg", &item); mCloseSvgItem->setVisible(false); diff --git a/src/tools/UBAbstractDrawRuler.h b/src/tools/UBAbstractDrawRuler.h index 5b66acc2..5916c5cf 100644 --- a/src/tools/UBAbstractDrawRuler.h +++ b/src/tools/UBAbstractDrawRuler.h @@ -29,6 +29,7 @@ #define UB_ABSTRACTDRAWRULER_H_ #include +#include #include "frameworks/UBGeometryUtils.h" class UBGraphicsScene; diff --git a/src/tools/UBGraphicsCompass.cpp b/src/tools/UBGraphicsCompass.cpp index 6e0b751f..660025c4 100644 --- a/src/tools/UBGraphicsCompass.cpp +++ b/src/tools/UBGraphicsCompass.cpp @@ -72,7 +72,7 @@ UBGraphicsCompass::UBGraphicsCompass() setFlag(QGraphicsItem::ItemIsSelectable, true); setFlag(QGraphicsItem::ItemSendsGeometryChanges, true); - setAcceptsHoverEvents(true); + setAcceptHoverEvents(true); mCloseSvgItem = new QGraphicsSvgItem(":/images/closeTool.svg", this); mCloseSvgItem->setVisible(false); diff --git a/src/web/UBOEmbedParser.cpp b/src/web/UBOEmbedParser.cpp index 78576980..0760f74e 100644 --- a/src/web/UBOEmbedParser.cpp +++ b/src/web/UBOEmbedParser.cpp @@ -226,8 +226,7 @@ sOEmbedContent UBOEmbedParser::getXMLInfos(const QString &xml) void UBOEmbedParser::onParseContent(QString url) { - QUrl qurl; - qurl.setEncodedUrl(url.toAscii()); + QUrl qurl = QUrl::fromEncoded(url.toLatin1()); QNetworkRequest req; req.setUrl(qurl); diff --git a/src/web/UBWebController.cpp b/src/web/UBWebController.cpp index 0c21d499..c116a0d2 100644 --- a/src/web/UBWebController.cpp +++ b/src/web/UBWebController.cpp @@ -28,6 +28,7 @@ #include #include #include +#include #include "frameworks/UBPlatformUtils.h" diff --git a/src/web/UBWebKitUtils.cpp b/src/web/UBWebKitUtils.cpp index 1bfc2d46..1dce1da9 100644 --- a/src/web/UBWebKitUtils.cpp +++ b/src/web/UBWebKitUtils.cpp @@ -24,6 +24,7 @@ #include +#include #include "UBWebKitUtils.h" diff --git a/src/web/browser/WBBrowserWindow.cpp b/src/web/browser/WBBrowserWindow.cpp index 6c93f3fe..8cba1382 100644 --- a/src/web/browser/WBBrowserWindow.cpp +++ b/src/web/browser/WBBrowserWindow.cpp @@ -70,6 +70,7 @@ #include #include +#include #include "core/UBSettings.h" #include "core/UBSetting.h" diff --git a/src/web/browser/WBChaseWidget.cpp b/src/web/browser/WBChaseWidget.cpp index dc10372e..e536eb38 100644 --- a/src/web/browser/WBChaseWidget.cpp +++ b/src/web/browser/WBChaseWidget.cpp @@ -69,6 +69,7 @@ #include "WBChaseWidget.h" #include +#include #include "core/memcheck.h" diff --git a/src/web/browser/WBChaseWidget.h b/src/web/browser/WBChaseWidget.h index 20793d93..90b2a0fc 100644 --- a/src/web/browser/WBChaseWidget.h +++ b/src/web/browser/WBChaseWidget.h @@ -70,6 +70,7 @@ #define WBCHASEWIDGET_H #include +#include class WBChaseWidget : public QWidget diff --git a/src/web/browser/WBDownloadManager.cpp b/src/web/browser/WBDownloadManager.cpp index bb51cda0..e52a314d 100644 --- a/src/web/browser/WBDownloadManager.cpp +++ b/src/web/browser/WBDownloadManager.cpp @@ -70,6 +70,7 @@ #include #include +#include #include "network/UBAutoSaver.h" #include "network/UBNetworkAccessManager.h" @@ -145,7 +146,7 @@ void WBDownloadItem::getFileName() { QSettings settings; settings.beginGroup(QLatin1String("downloadmanager")); - QString defaultLocation = !mCustomDownloadPath.isEmpty() ? mCustomDownloadPath : QDesktopServices::storageLocation(QDesktopServices::DesktopLocation); + QString defaultLocation = !mCustomDownloadPath.isEmpty() ? mCustomDownloadPath : QStandardPaths::writableLocation(QStandardPaths::DesktopLocation); QString downloadDirectory = settings.value(QLatin1String("downloadDirectory"), defaultLocation).toString(); if (!downloadDirectory.isEmpty()) downloadDirectory += QLatin1Char('/'); diff --git a/src/web/browser/WBDownloadManager.h b/src/web/browser/WBDownloadManager.h index 8134cd01..53d013d6 100644 --- a/src/web/browser/WBDownloadManager.h +++ b/src/web/browser/WBDownloadManager.h @@ -74,6 +74,7 @@ #include #include +#include class WBDownloadItem : public QWidget, public Ui_DownloadItem { diff --git a/src/web/browser/WBEditTableView.h b/src/web/browser/WBEditTableView.h index 6cf7d20c..0a33617f 100644 --- a/src/web/browser/WBEditTableView.h +++ b/src/web/browser/WBEditTableView.h @@ -70,6 +70,7 @@ #define WBEDITTABLEVIEW_H #include +#include class WBEditTableView : public QTableView { diff --git a/src/web/browser/WBModelMenu.h b/src/web/browser/WBModelMenu.h index ead85a76..af921b26 100644 --- a/src/web/browser/WBModelMenu.h +++ b/src/web/browser/WBModelMenu.h @@ -70,6 +70,7 @@ #define WBMODELMENU_H #include +#include // A QMenu that is dynamically populated from a QAbstractItemModel class WBModelMenu : public QMenu diff --git a/src/web/browser/WBSearchLineEdit.cpp b/src/web/browser/WBSearchLineEdit.cpp index a3ba1a88..c8344675 100644 --- a/src/web/browser/WBSearchLineEdit.cpp +++ b/src/web/browser/WBSearchLineEdit.cpp @@ -69,6 +69,7 @@ #include "WBSearchLineEdit.h" #include +#include #include "core/memcheck.h" diff --git a/src/web/browser/WBSearchLineEdit.h b/src/web/browser/WBSearchLineEdit.h index 47479525..236d52eb 100644 --- a/src/web/browser/WBSearchLineEdit.h +++ b/src/web/browser/WBSearchLineEdit.h @@ -72,6 +72,7 @@ #include "WBUrlLineEdit.h" #include +#include class WBSearchButton; diff --git a/src/web/browser/WBSqueezeLabel.h b/src/web/browser/WBSqueezeLabel.h index ac578cf5..712df8cc 100644 --- a/src/web/browser/WBSqueezeLabel.h +++ b/src/web/browser/WBSqueezeLabel.h @@ -69,7 +69,7 @@ #ifndef WBSQUEEZELABEL_H #define WBSQUEEZELABEL_H -#include +#include class WBSqueezeLabel : public QLabel { diff --git a/src/web/browser/WBTabWidget.cpp b/src/web/browser/WBTabWidget.cpp index b552fcba..d96f9472 100644 --- a/src/web/browser/WBTabWidget.cpp +++ b/src/web/browser/WBTabWidget.cpp @@ -78,6 +78,8 @@ #include #include +#include +#include #include "core/memcheck.h" diff --git a/src/web/browser/WBTabWidget.h b/src/web/browser/WBTabWidget.h index 9a3f57ca..75c47fc4 100644 --- a/src/web/browser/WBTabWidget.h +++ b/src/web/browser/WBTabWidget.h @@ -70,6 +70,14 @@ #define WBTABWIDGET_H #include +#include +#include +#include +#include +#include +#include +#include + /* Tab bar with a few more features such as a context menu and shortcuts */ diff --git a/src/web/browser/WBToolBarSearch.cpp b/src/web/browser/WBToolBarSearch.cpp index c6dd9053..b8ddc4c7 100644 --- a/src/web/browser/WBToolBarSearch.cpp +++ b/src/web/browser/WBToolBarSearch.cpp @@ -70,6 +70,8 @@ #include #include +#include +#include #include "network/UBAutoSaver.h" @@ -142,10 +144,13 @@ void WBToolbarSearch::searchNow() } QUrl url(QLatin1String("http://www.google.com/search")); - url.addQueryItem(QLatin1String("q"), searchText); - url.addQueryItem(QLatin1String("ie"), QLatin1String("UTF-8")); - url.addQueryItem(QLatin1String("oe"), QLatin1String("UTF-8")); - url.addQueryItem(QLatin1String("client"), QLatin1String("uniboard-browser")); + QUrlQuery urlQuery; + + urlQuery.addQueryItem(QLatin1String("q"), searchText); + urlQuery.addQueryItem(QLatin1String("ie"), QLatin1String("UTF-8")); + urlQuery.addQueryItem(QLatin1String("oe"), QLatin1String("UTF-8")); + urlQuery.addQueryItem(QLatin1String("client"), QLatin1String("uniboard-browser")); + url.setQuery(urlQuery); emit search(url); } diff --git a/src/web/browser/WBUrlLineEdit.cpp b/src/web/browser/WBUrlLineEdit.cpp index 494c2eaa..246895bf 100644 --- a/src/web/browser/WBUrlLineEdit.cpp +++ b/src/web/browser/WBUrlLineEdit.cpp @@ -74,6 +74,10 @@ #include "globals/UBGlobals.h" #include +#include +#include +#include +#include #include "core/memcheck.h" diff --git a/src/web/browser/WBUrlLineEdit.h b/src/web/browser/WBUrlLineEdit.h index 3247c53b..37090eff 100644 --- a/src/web/browser/WBUrlLineEdit.h +++ b/src/web/browser/WBUrlLineEdit.h @@ -70,6 +70,9 @@ #define WBURLLINEEDIT_H #include +#include +#include +#include #include "WBWebView.h" diff --git a/src/web/browser/WBWebTrapWebView.cpp b/src/web/browser/WBWebTrapWebView.cpp index b036059f..8f0e7bc5 100644 --- a/src/web/browser/WBWebTrapWebView.cpp +++ b/src/web/browser/WBWebTrapWebView.cpp @@ -29,6 +29,8 @@ #include #include +#include +#include #include "web/UBWebKitUtils.h" diff --git a/src/web/browser/WBWebTrapWebView.h b/src/web/browser/WBWebTrapWebView.h index 57bd7fc1..00679fe1 100644 --- a/src/web/browser/WBWebTrapWebView.h +++ b/src/web/browser/WBWebTrapWebView.h @@ -30,6 +30,7 @@ #include #include +#include class WBWebTrapWebView : public QWebView diff --git a/src/web/browser/WBWebView.cpp b/src/web/browser/WBWebView.cpp index e83b31ae..52bbef37 100644 --- a/src/web/browser/WBWebView.cpp +++ b/src/web/browser/WBWebView.cpp @@ -82,6 +82,8 @@ #include #include #include +#include +#include #include "core/memcheck.h"