diff --git a/CMakeLists.txt b/CMakeLists.txt index eb9d19578..331cf1386 100755 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -234,7 +234,7 @@ message(STATUS "[${APP_LOW_NAME}] Enabling fast QString concatenation.") add_definitions(-DQT_USE_FAST_CONCATENATION) add_definitions(-DQT_USE_FAST_OPERATOR_PLUS) -# Configure executable "properties" for Windows or OS2. +# Configure executable "properties" for Windows. if(WIN32) message(STATUS "[${APP_LOW_NAME}] Generating executable file properties for Windows.") configure_file ( @@ -248,7 +248,7 @@ if(WIN32 AND MSVC) set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} /SUBSYSTEM:WINDOWS,5.01" ) endif(WIN32 AND MSVC) -# Compile application icon if compiling with MinGW on WIN32 or with OS2. +# Compile application icon if compiling with MinGW on WIN32. if(WIN32 AND MINGW) enable_language(RC) set(CMAKE_RC_COMPILER_INIT windres) diff --git a/src/core/messagesmodel.cpp b/src/core/messagesmodel.cpp index 8a4a25a20..b016f92d3 100755 --- a/src/core/messagesmodel.cpp +++ b/src/core/messagesmodel.cpp @@ -162,12 +162,7 @@ void MessagesModel::setupHeaderData() { Qt::ItemFlags MessagesModel::flags(const QModelIndex &index) const { Q_UNUSED(index) -#if QT_VERSION >= 0x050000 return Qt::ItemIsSelectable | Qt::ItemIsEnabled | Qt::ItemIsEditable | Qt::ItemNeverHasChildren; -#else - - return Qt::ItemIsSelectable | Qt::ItemIsEnabled | Qt::ItemIsEditable; -#endif } QVariant MessagesModel::data(int row, int column, int role) const { diff --git a/src/definitions/definitions.h.in b/src/definitions/definitions.h.in index 338567984..cf5e91a01 100755 --- a/src/definitions/definitions.h.in +++ b/src/definitions/definitions.h.in @@ -152,16 +152,12 @@ #define APP_THEME_SUFFIX ".png" #ifndef QSL -#if QT_VERSION >= 0x050000 // Thin macro wrapper for literal strings. // They are much more memory efficient and faster. // Use it for all literals except for two cases: // a) Methods which take QLatin1String (use QLatin1String for literal argument too), // b) Construction of empty literals "", use QString() instead of QStringLiteral(""). #define QSL(x) QStringLiteral(x) -#else -#define QSL(x) QLatin1String(x) -#endif #endif #ifndef QL1S diff --git a/src/gui/dialogs/formsettings.cpp b/src/gui/dialogs/formsettings.cpp index 5065ac916..71e2d64ac 100755 --- a/src/gui/dialogs/formsettings.cpp +++ b/src/gui/dialogs/formsettings.cpp @@ -85,7 +85,6 @@ FormSettings::FormSettings(QWidget *parent) : QDialog(parent), m_ui(new Ui::Form << tr("Author") << tr("E-mail")); -#if QT_VERSION >= 0x050000 // Setup languages. m_ui->m_treeLanguages->header()->setSectionResizeMode(0, QHeaderView::ResizeToContents); m_ui->m_treeLanguages->header()->setSectionResizeMode(1, QHeaderView::ResizeToContents); @@ -98,20 +97,6 @@ FormSettings::FormSettings(QWidget *parent) : QDialog(parent), m_ui(new Ui::Form m_ui->m_treeSkins->header()->setSectionResizeMode(1, QHeaderView::ResizeToContents); m_ui->m_treeSkins->header()->setSectionResizeMode(2, QHeaderView::ResizeToContents); m_ui->m_treeSkins->header()->setSectionResizeMode(3, QHeaderView::ResizeToContents); -#else - // Setup languages. - m_ui->m_treeLanguages->header()->setResizeMode(0, QHeaderView::ResizeToContents); - m_ui->m_treeLanguages->header()->setResizeMode(1, QHeaderView::ResizeToContents); - m_ui->m_treeLanguages->header()->setResizeMode(2, QHeaderView::ResizeToContents); - m_ui->m_treeLanguages->header()->setResizeMode(3, QHeaderView::ResizeToContents); - m_ui->m_treeLanguages->header()->setResizeMode(4, QHeaderView::ResizeToContents); - - // Setup skins. - m_ui->m_treeSkins->header()->setResizeMode(0, QHeaderView::ResizeToContents); - m_ui->m_treeSkins->header()->setResizeMode(1, QHeaderView::ResizeToContents); - m_ui->m_treeSkins->header()->setResizeMode(2, QHeaderView::ResizeToContents); - m_ui->m_treeSkins->header()->setResizeMode(3, QHeaderView::ResizeToContents); -#endif // Establish needed connections. connect(m_ui->m_buttonBox, SIGNAL(accepted()), this, SLOT(saveSettings())); @@ -749,15 +734,7 @@ void FormSettings::loadInterface() { m_ui->m_cmbIconTheme->setCurrentIndex(0); } else { -#if QT_VERSION >= 0x050000 m_ui->m_cmbIconTheme->setCurrentText(current_theme); -#else - int theme_index = m_ui->m_cmbIconTheme->findText(current_theme); - - if (theme_index >= 0) { - m_ui->m_cmbIconTheme->setCurrentIndex(theme_index); - } -#endif } // Load skin. diff --git a/src/gui/feedsview.cpp b/src/gui/feedsview.cpp index a1475573b..09d4f6975 100755 --- a/src/gui/feedsview.cpp +++ b/src/gui/feedsview.cpp @@ -433,15 +433,9 @@ QMenu *FeedsView::initializeContextMenuOtherItem(RootItem *clicked_item) { } void FeedsView::setupAppearance() { -#if QT_VERSION >= 0x050000 // Setup column resize strategies. header()->setSectionResizeMode(FDS_MODEL_TITLE_INDEX, QHeaderView::Stretch); header()->setSectionResizeMode(FDS_MODEL_COUNTS_INDEX, QHeaderView::ResizeToContents); -#else - // Setup column resize strategies. - header()->setResizeMode(FDS_MODEL_TITLE_INDEX, QHeaderView::Stretch); - header()->setResizeMode(FDS_MODEL_COUNTS_INDEX, QHeaderView::ResizeToContents); -#endif setUniformRowHeights(true); setAnimated(true); diff --git a/src/gui/messagesview.cpp b/src/gui/messagesview.cpp index 79ce2b30f..8ff574b03 100755 --- a/src/gui/messagesview.cpp +++ b/src/gui/messagesview.cpp @@ -231,13 +231,11 @@ void MessagesView::loadItem(RootItem *item) { m_sourceModel->setSort(col, ord); m_sourceModel->loadMessages(item); -#if QT_VERSION >= 0x050000 // Messages are loaded, make sure that previously // active message is not shown in browser. // BUG: Qt 5 is probably bugged here. Selections // should be cleared automatically when SQL model is reset. emit currentMessagesRemoved(); -#endif } void MessagesView::openSelectedSourceMessagesExternally() { @@ -506,7 +504,6 @@ void MessagesView::adjustColumns() { if (header()->count() > 0 && !m_columnsAdjusted) { m_columnsAdjusted = true; -#if QT_VERSION >= 0x050000 // Setup column resize strategies. header()->setSectionResizeMode(MSG_DB_ID_INDEX, QHeaderView::Interactive); header()->setSectionResizeMode(MSG_DB_READ_INDEX, QHeaderView::ResizeToContents); @@ -519,20 +516,6 @@ void MessagesView::adjustColumns() { header()->setSectionResizeMode(MSG_DB_DCREATED_INDEX, QHeaderView::Interactive); header()->setSectionResizeMode(MSG_DB_CONTENTS_INDEX, QHeaderView::Interactive); header()->setSectionResizeMode(MSG_DB_PDELETED_INDEX, QHeaderView::Interactive); -#else - // Setup column resize strategies. - header()->setResizeMode(MSG_DB_ID_INDEX, QHeaderView::Interactive); - header()->setResizeMode(MSG_DB_READ_INDEX, QHeaderView::ResizeToContents); - header()->setResizeMode(MSG_DB_DELETED_INDEX, QHeaderView::Interactive); - header()->setResizeMode(MSG_DB_IMPORTANT_INDEX, QHeaderView::ResizeToContents); - header()->setResizeMode(MSG_DB_FEED_INDEX, QHeaderView::Interactive); - header()->setResizeMode(MSG_DB_TITLE_INDEX, QHeaderView::Stretch); - header()->setResizeMode(MSG_DB_URL_INDEX, QHeaderView::Interactive); - header()->setResizeMode(MSG_DB_AUTHOR_INDEX, QHeaderView::Interactive); - header()->setResizeMode(MSG_DB_DCREATED_INDEX, QHeaderView::Interactive); - header()->setResizeMode(MSG_DB_CONTENTS_INDEX, QHeaderView::Interactive); - header()->setResizeMode(MSG_DB_PDELETED_INDEX, QHeaderView::Interactive); -#endif // Hide columns. hideColumn(MSG_DB_ID_INDEX); diff --git a/src/gui/notifications/notification.cpp b/src/gui/notifications/notification.cpp index 671a55dc1..63c2094c3 100755 --- a/src/gui/notifications/notification.cpp +++ b/src/gui/notifications/notification.cpp @@ -221,11 +221,7 @@ void Notification::paintEvent(QPaintEvent *event) { } // Draw background. -#if QT_VERSION >= 0x050000 painter.setRenderHints(QPainter::HighQualityAntialiasing | QPainter::Qt4CompatiblePainting); -#else - painter.setRenderHints(QPainter::HighQualityAntialiasing); -#endif painter.setBrush(m_backgroundColor); painter.setPen(Qt::NoPen); @@ -287,9 +283,7 @@ void Notification::setupWidget() { Qt::WindowFlags window_flags = Qt::FramelessWindowHint | Qt::WindowSystemMenuHint | Qt::WindowStaysOnTopHint | Qt::X11BypassWindowManagerHint; -#if QT_VERSION >= 0x050000 window_flags |= Qt::WindowDoesNotAcceptFocus; -#endif #if defined (Q_OS_MAC) window_flags |= Qt::SubWindow; diff --git a/src/main.cpp b/src/main.cpp index 4d28793b1..6ce6dadfe 100755 --- a/src/main.cpp +++ b/src/main.cpp @@ -56,11 +56,7 @@ int main(int argc, char *argv[]) { #endif // Setup debug output system. -#if QT_VERSION >= 0x050000 qInstallMessageHandler(Debugging::debugHandler); -#else - qInstallMsgHandler(Debugging::debugHandler); -#endif // Instantiate base application object. Application application(APP_LOW_NAME, argc, argv); diff --git a/src/miscellaneous/debugging.cpp b/src/miscellaneous/debugging.cpp index 9ea8e0ba4..0586c5e65 100755 --- a/src/miscellaneous/debugging.cpp +++ b/src/miscellaneous/debugging.cpp @@ -62,7 +62,6 @@ const char *Debugging::typeToString(QtMsgType type) { } } -#if QT_VERSION >= 0x050000 void Debugging::debugHandler(QtMsgType type, const QMessageLogContext &placement, const QString &message) { #ifndef QT_NO_DEBUG_OUTPUT performLog(qPrintable(message), type, placement.file, placement.function, placement.line); @@ -72,13 +71,3 @@ void Debugging::debugHandler(QtMsgType type, const QMessageLogContext &placement Q_UNUSED(message) #endif } -#else -void Debugging::debugHandler(QtMsgType type, const char *message) { -#ifndef QT_NO_DEBUG_OUTPUT - performLog(message, type); -#else - Q_UNUSED(type) - Q_UNUSED(message) -#endif -} -#endif diff --git a/src/miscellaneous/debugging.h b/src/miscellaneous/debugging.h index 396329423..b873dfa9f 100755 --- a/src/miscellaneous/debugging.h +++ b/src/miscellaneous/debugging.h @@ -25,12 +25,7 @@ class Debugging { public: // Specifies format of output console messages. // NOTE: QT_NO_DEBUG_OUTPUT - disables debug outputs completely!!! -#if QT_VERSION >= 0x050000 static void debugHandler(QtMsgType type, const QMessageLogContext &placement, const QString &message); -#else - static void debugHandler(QtMsgType type, const char *message); -#endif - static void performLog(const char *message, QtMsgType type, const char *file = 0, const char *function = 0, int line = -1); static const char *typeToString(QtMsgType type); diff --git a/src/miscellaneous/iofactory.cpp b/src/miscellaneous/iofactory.cpp index 61956aa04..ee623378c 100755 --- a/src/miscellaneous/iofactory.cpp +++ b/src/miscellaneous/iofactory.cpp @@ -31,11 +31,7 @@ IOFactory::IOFactory() { } QString IOFactory::getSystemFolder(SYSTEM_FOLDER_ENUM::StandardLocation location) { -#if QT_VERSION >= 0x050000 return SYSTEM_FOLDER_ENUM::writableLocation(location); -#else - return SYSTEM_FOLDER_ENUM::storageLocation(location); -#endif } QString IOFactory::ensureUniqueFilename(const QString &name, const QString &append_format) { diff --git a/src/miscellaneous/iofactory.h b/src/miscellaneous/iofactory.h index b00dd23b4..f99337b61 100755 --- a/src/miscellaneous/iofactory.h +++ b/src/miscellaneous/iofactory.h @@ -22,13 +22,8 @@ #include "definitions/definitions.h" -#if QT_VERSION >= 0x050000 #include #define SYSTEM_FOLDER_ENUM QStandardPaths -#else -#include -#define SYSTEM_FOLDER_ENUM QDesktopServices -#endif class IOFactory { diff --git a/src/miscellaneous/localization.cpp b/src/miscellaneous/localization.cpp index 8e5d611b2..8ab6fada3 100755 --- a/src/miscellaneous/localization.cpp +++ b/src/miscellaneous/localization.cpp @@ -76,12 +76,7 @@ QList Localization::installedLanguages() const { new_language.m_version = translator.translate("QObject", "LANG_VERSION"); new_language.m_author = translator.translate("QObject", "LANG_AUTHOR"); new_language.m_email = translator.translate("QObject", "LANG_EMAIL"); - -#if QT_VERSION >= 0x040800 new_language.m_name = QLocale(new_language.m_code).nativeLanguageName(); -#else - new_language.m_name = translator.translate("QObject", "LANG_NAME"); -#endif languages << new_language; } diff --git a/src/miscellaneous/systemfactory.cpp b/src/miscellaneous/systemfactory.cpp index d1d2bb74d..ad4a74697 100755 --- a/src/miscellaneous/systemfactory.cpp +++ b/src/miscellaneous/systemfactory.cpp @@ -33,12 +33,7 @@ #include #include #include - -#if QT_VERSION >= 0x050000 #include -#else -#include -#endif typedef QPair UpdateCheck; diff --git a/src/network-web/networkfactory.cpp b/src/network-web/networkfactory.cpp index 7f63adf4c..0cc3c41f8 100755 --- a/src/network-web/networkfactory.cpp +++ b/src/network-web/networkfactory.cpp @@ -132,11 +132,7 @@ QNetworkReply::NetworkError NetworkFactory::downloadIcon(const QList &u QNetworkReply::NetworkError network_result; foreach (const QString &url, urls) { -#if QT_VERSION >= 0x050000 const QString google_s2_with_url = QString("http://www.google.com/s2/favicons?domain=%1").arg(url.toHtmlEscaped()); -#else - const QString google_s2_with_url = QString("http://www.google.com/s2/favicons?domain=%1").arg(Qt::escape(url)); -#endif QByteArray icon_data; network_result = downloadFile(google_s2_with_url, timeout, icon_data).first; diff --git a/src/network-web/webfactory.cpp b/src/network-web/webfactory.cpp index 8e876f8bc..968481cfe 100755 --- a/src/network-web/webfactory.cpp +++ b/src/network-web/webfactory.cpp @@ -146,7 +146,6 @@ QString WebFactory::deEscapeHtml(const QString &text) { } QString WebFactory::toSecondLevelDomain(const QUrl &url) { -#if QT_VERSION >= 0x040800 const QString top_level_domain = url.topLevelDomain(); const QString url_host = url.host(); @@ -165,19 +164,6 @@ QString WebFactory::toSecondLevelDomain(const QUrl &url) { } return domain + top_level_domain; -#else - QString domain = url.host(); - - if (domain.count(QL1C('.')) == 0) { - return QString(); - } - - while (domain.count(QL1C('.')) != 1) { - domain = domain.mid(domain.indexOf(QL1C('.')) + 1); - } - - return domain; -#endif } void WebFactory::generetaEscapes() { diff --git a/src/network-web/webview.cpp b/src/network-web/webview.cpp index 044d2c9a9..b80afde85 100755 --- a/src/network-web/webview.cpp +++ b/src/network-web/webview.cpp @@ -37,12 +37,7 @@ #include #include #include - -#if QT_VERSION >= 0x050000 #include -#else -#include -#endif WebView::WebView(QWidget *parent) @@ -168,11 +163,7 @@ void WebView::setupIcons() { m_actionCopyImage->setIcon(qApp->icons()->fromTheme(QSL("edit-copy-image"))); m_actionSaveHyperlinkAs->setIcon(qApp->icons()->fromTheme(QSL("document-download"))); m_actionSaveImageAs->setIcon(qApp->icons()->fromTheme(QSL("document-download"))); - -#if QT_VERSION >= 0x040800 m_actionCopyImageUrl->setIcon(qApp->icons()->fromTheme(QSL("edit-copy"))); -#endif - m_actionOpenLinkThisTab->setIcon(qApp->icons()->fromTheme(QSL("item-open-internal"))); m_actionOpenLinkNewTab->setIcon(qApp->icons()->fromTheme(QSL("item-open-internal"))); m_actionOpenLinkExternally->setIcon(qApp->icons()->fromTheme(QSL("item-open-external"))); @@ -192,11 +183,6 @@ void WebView::initializeActions() { m_actionCopySelectedItem = pageAction(QWebEnginePage::Copy); m_actionCopySelectedItem->setParent(this); -#if defined(Q_OS_OS2) - m_actionCopySelectedItem->setShortcut(QKeySequence::Copy); - addAction(m_actionCopySelectedItem); -#endif - m_actionSaveHyperlinkAs = pageAction(QWebEnginePage::DownloadLinkToDisk); m_actionSaveHyperlinkAs->setParent(this); @@ -210,10 +196,8 @@ void WebView::initializeActions() { m_actionSaveImageAs->setParent(this); m_actionSavePageAs = new QAction(qApp->icons()->fromTheme(QSL("document-download")), tr("Save page as..."), this); -#if QT_VERSION >= 0x040800 m_actionCopyImageUrl = pageAction(QWebEnginePage::CopyImageUrlToClipboard); m_actionCopyImageUrl->setParent(this); -#endif m_actionOpenLinkNewTab = pageAction(QWebEnginePage::OpenLinkInNewTab); m_actionOpenLinkNewTab->setParent(this); @@ -244,10 +228,8 @@ void WebView::setActionTexts() { m_actionSaveImageAs->setText(tr("Save image as...")); m_actionSaveImageAs->setToolTip(tr("Save image to disk.")); -#if QT_VERSION >= 0x040800 m_actionCopyImageUrl->setText(tr("Copy image url")); m_actionCopyImageUrl->setToolTip(tr("Copy image url to clipboard.")); -#endif m_actionOpenLinkNewTab->setText(tr("Open link in new tab")); m_actionOpenLinkNewTab->setToolTip(tr("Open this hyperlink in new tab.")); diff --git a/src/network-web/webview.h b/src/network-web/webview.h index 8aa11e8b9..1630f179b 100755 --- a/src/network-web/webview.h +++ b/src/network-web/webview.h @@ -104,11 +104,7 @@ class WebView : public QWebEngineView { QAction *m_actionSavePageAs; QAction *m_actionSaveHyperlinkAs; QAction *m_actionSaveImageAs; - -#if QT_VERSION >= 0x040800 QAction *m_actionCopyImageUrl; -#endif - QAction *m_actionOpenLinkThisTab; QAction *m_actionOpenLinkNewTab; QAction *m_actionOpenLinkExternally; diff --git a/src/services/abstract/feed.cpp b/src/services/abstract/feed.cpp index 3df7fb925..956632a9f 100755 --- a/src/services/abstract/feed.cpp +++ b/src/services/abstract/feed.cpp @@ -222,9 +222,7 @@ int Feed::updateMessages(const QList &messages) { QString new_message_url = QUrl(url()).toString(QUrl::RemoveUserInfo | QUrl::RemovePath | QUrl::RemoveQuery | - #if QT_VERSION >= 0x050000 QUrl::RemoveFilename | - #endif QUrl::StripTrailingSlash); new_message_url += message.m_url;