diff --git a/CMakeLists.txt b/CMakeLists.txt --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -10,7 +10,7 @@ find_package(ECM 0.0.11 REQUIRED NO_MODULE) -set(CMAKE_MODULE_PATH ${ECM_MODULE_PATH} ${ECM_KDE_MODULE_DIR} ${CMAKE_CURRENT_SOURCE_DIR}/cmake/modules) +set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${ECM_MODULE_PATH} ${ECM_KDE_MODULE_DIR} ${CMAKE_CURRENT_SOURCE_DIR}/cmake/modules) include(KDEInstallDirs) include(KDECMakeSettings) @@ -63,12 +63,15 @@ find_package(KF5 REQUIRED COMPONENTS Config CoreAddons - KDELibs4Support - #I18n - #WebKit + Completion + I18n Package Plasma NewStuff + KIO + IconThemes + TextWidgets + OPTIONAL_COMPONENTS ${OPT_KF5_COMPONENTS} ) set(QT_USE_LIBSPREFIX Qt5::) @@ -83,14 +86,6 @@ if(CMAKE_COMPILER_IS_GNUCC) set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-deprecated-declarations") endif() - add_definitions( - -DKDELIBS4SUPPORT_EXPORT_WRAPPER_H - -DKDELIBS4SUPPORT_DEPRECATED_NOISE= - -DKDELIBS4SUPPORT_DEPRECATED_EXPORT_NOISE=Q_DECL_IMPORT - -DKDELIBS4SUPPORT_DEPRECATED= - -DKDELIBS4SUPPORT_DEPRECATED_EXPORT=Q_DECL_IMPORT - -DKDELIBS4SUPPORT_EXPORT=Q_DECL_IMPORT - ) endif() # figure out which multi-precision library to use diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -38,7 +38,6 @@ PRIVATE ${QT_USE_LIBSPREFIX}WebKitWidgets KF5::CoreAddons - KF5::KDELibs4Support KF5::NewStuff ) endif() @@ -72,7 +71,11 @@ ) set(alkimia_UI +if(BUILD_QT4) alkonlinequoteswidget.ui +else() + alkonlinequoteswidget5.ui +endif() ) configure_file( @@ -105,8 +108,13 @@ set(ALKIMIA_LIBS PRIVATE ${QT_USE_LIBSPREFIX}WebKitWidgets - KF5::KDELibs4Support + KF5::Completion + KF5::I18n KF5::NewStuff + KF5::IconThemes + KF5::TextWidgets + KF5::KIOCore + KF5::KIOWidgets ) add_definitions(-DTRANSLATION_DOMAIN=\"alkimia\") endif() diff --git a/src/alkonlinequote.cpp b/src/alkonlinequote.cpp --- a/src/alkonlinequote.cpp +++ b/src/alkonlinequote.cpp @@ -1,5 +1,6 @@ /*************************************************************************** * Copyright 2004 Ace Jones * + * Copyright 2019 Thomas Baumgart * * * * This file is part of libalkimia. * * * @@ -36,16 +37,29 @@ #include #include +#if QT_VERSION >= QT_VERSION_CHECK(5,0,0) + #include + #include + #include + #include + #include + #define kDebug(a) qDebug() + #define KIcon QIcon + #define KUrl QUrl + #define prettyUrl() toDisplayString() +#else + #include + #include + #include + #include + #include + #include +#endif + #include -#include #include -#include -#include -#include -#include #include #include -#include AlkOnlineQuote::Errors::Errors() { @@ -94,11 +108,19 @@ AlkOnlineQuotesProfile *m_profile; bool m_ownProfile; +#if QT_VERSION >= QT_VERSION_CHECK(5,0,0) +private slots: + void downloadUrlDone(KJob* job); + +public: + +#else static int dbgArea() { static int s_area = KDebug::registerArea("Alkimia (AlkOnlineQuote)"); return s_area; } +#endif Private(AlkOnlineQuote *parent) : m_p(parent) @@ -123,6 +145,8 @@ void enter_loop(); bool parsePrice(const QString &pricestr); bool parseDate(const QString &datestr); + bool downloadUrl(const QUrl& url); + bool processDownloadedFile(const QUrl& url, const QString& tmpFile); public slots: void slotLoadStarted(); @@ -245,6 +269,7 @@ m_eventLoop = new QEventLoop; m_eventLoop->exec(); delete m_eventLoop; + m_eventLoop = nullptr; disconnect(webPage, SIGNAL(loadStarted()), this, SLOT(slotLoadStarted())); disconnect(webPage, SIGNAL(loadFinished(bool)), this, SLOT(slotLoadFinishedCssSelector(bool))); @@ -266,6 +291,7 @@ m_eventLoop = new QEventLoop; m_eventLoop->exec(); delete m_eventLoop; + m_eventLoop = nullptr; disconnect(webPage, SIGNAL(loadStarted()), this, SLOT(slotLoadStarted())); disconnect(webPage, SIGNAL(loadFinished(bool)), this, SLOT(slotLoadFinishedHtmlParser(bool))); @@ -301,41 +327,95 @@ } } else { slotLoadStarted(); + result = downloadUrl(url); + } + return result; +} - QString tmpFile; - if (KIO::NetAccess::download(url, tmpFile, 0)) { - // kDebug(Private::dbgArea()) << "Downloaded " << tmpFile; - kDebug(Private::dbgArea()) << "Downloaded" << tmpFile << "from" << url; - QFile f(tmpFile); - if (f.open(QIODevice::ReadOnly)) { - // Find out the page encoding and convert it to unicode - QByteArray page = f.readAll(); - KEncodingProber prober(KEncodingProber::Universal); - prober.feed(page); - QTextCodec *codec = QTextCodec::codecForName(prober.encoding()); - if (!codec) { - codec = QTextCodec::codecForLocale(); - } - QString quote = codec->toUnicode(page); - f.close(); - emit m_p->status(i18n("URL found: %1...", url.prettyUrl())); - if (AlkOnlineQuotesProfileManager::instance().webPageEnabled()) - AlkOnlineQuotesProfileManager::instance().webPage()->setContent(quote.toLocal8Bit()); - result = slotParseQuote(quote); - } else { - emit m_p->error(i18n("Failed to open downloaded file")); - m_errors |= Errors::URL; - result = slotParseQuote(QString()); - } - KIO::NetAccess::removeTempFile(tmpFile); - } else { - emit m_p->error(KIO::NetAccess::lastErrorString()); - m_errors |= Errors::URL; - result = slotParseQuote(QString()); - } +bool AlkOnlineQuote::Private::processDownloadedFile(const QUrl& url, const QString& tmpFile) +{ + bool result = false; + + QFile f(tmpFile); + if (f.open(QIODevice::ReadOnly)) { + // Find out the page encoding and convert it to unicode + QByteArray page = f.readAll(); + KEncodingProber prober(KEncodingProber::Universal); + prober.feed(page); + QTextCodec *codec = QTextCodec::codecForName(prober.encoding()); + if (!codec) { + codec = QTextCodec::codecForLocale(); + } + QString quote = codec->toUnicode(page); + f.close(); + emit m_p->status(i18n("URL found: %1...", url.prettyUrl())); + if (AlkOnlineQuotesProfileManager::instance().webPageEnabled()) + AlkOnlineQuotesProfileManager::instance().webPage()->setContent(quote.toLocal8Bit()); + result = slotParseQuote(quote); + } else { + emit m_p->error(i18n("Failed to open downloaded file")); + m_errors |= Errors::URL; + result = slotParseQuote(QString()); + } + return result; +} + +#if QT_VERSION >= QT_VERSION_CHECK(5,0,0) +bool AlkOnlineQuote::Private::downloadUrl(const QUrl& url) +{ + QTemporaryFile tmpFile; + tmpFile.open(); + auto tmpFileName = QUrl::fromLocalFile(tmpFile.fileName()); + + m_eventLoop = new QEventLoop; + + KJob *job = KIO::file_copy(url, tmpFileName, -1, KIO::HideProgressInfo | KIO::Overwrite); + connect(job, SIGNAL(result(KJob*)), this, SLOT(downloadUrlDone(KJob*))); + + auto result = m_eventLoop->exec(QEventLoop::ExcludeUserInputEvents); + delete m_eventLoop; + m_eventLoop = nullptr; + + return result; +} + +void AlkOnlineQuote::Private::downloadUrlDone(KJob* job) +{ + QString tmpFileName = dynamic_cast(job)->destUrl().toLocalFile(); + QUrl url = dynamic_cast(job)->srcUrl(); + + bool result; + if (!job->error()) { + qDebug() << "Downloaded" << tmpFileName << "from" << url; + result = processDownloadedFile(url, tmpFileName); + } else { + emit m_p->error(job->errorString()); + m_errors |= Errors::URL; + result = slotParseQuote(QString()); + } + m_eventLoop->exit(result); +} + +#else + +bool AlkOnlineQuote::Private::downloadUrl(const QUrl& url) +{ + bool result = false; + + QString tmpFile; + if (KIO::NetAccess::download(url, tmpFile, 0)) { + // kDebug(Private::dbgArea()) << "Downloaded " << tmpFile; + kDebug(Private::dbgArea()) << "Downloaded" << tmpFile << "from" << url; + result = processDownloadedFile(url, tmpFile); + KIO::NetAccess::removeTempFile(tmpFile); + } else { + emit m_p->error(KIO::NetAccess::lastErrorString()); + m_errors |= Errors::URL; + result = slotParseQuote(QString()); } return result; } +#endif bool AlkOnlineQuote::Private::launchFinanceQuote(const QString &_symbol, const QString &_id, const QString &_sourcename) diff --git a/src/alkonlinequotesprofile.cpp b/src/alkonlinequotesprofile.cpp --- a/src/alkonlinequotesprofile.cpp +++ b/src/alkonlinequotesprofile.cpp @@ -1,5 +1,6 @@ /*************************************************************************** * Copyright 2018 Ralf Habacker * + * Copyright 2019 Thomas Baumgart * * * * This file is part of libalkimia. * * * @@ -31,8 +32,13 @@ #include #include -#include -#include + +#if QT_VERSION >= QT_VERSION_CHECK(5,0,0) + #include +#else + #include + #include +#endif #include class AlkOnlineQuotesProfile::Private : public QObject @@ -51,18 +57,27 @@ static QString m_financeQuoteScriptPath; static QStringList m_financeQuoteSources; + bool setupFinanceQuoteScriptPath() + { + if (m_financeQuoteScriptPath.isEmpty()) { +#if QT_VERSION >= QT_VERSION_CHECK(5,0,0) + m_financeQuoteScriptPath = QStandardPaths::locate(QStandardPaths::AppDataLocation, QStringLiteral("misc/financequote.pl")); +#else + m_financeQuoteScriptPath = KGlobal::dirs()->findResource("appdata", + QString("misc/financequote.pl")); +#endif + } + return !m_financeQuoteScriptPath.isEmpty(); + } + Private(AlkOnlineQuotesProfile *p) : m_p(p) , m_profileManager(0) , m_manager(0) , m_config(0) , m_type(Type::Undefined) { - - if (m_financeQuoteScriptPath.isEmpty()) { - m_financeQuoteScriptPath = KGlobal::dirs()->findResource("appdata", - QString("misc/financequote.pl")); - } + setupFinanceQuoteScriptPath(); } ~Private() @@ -139,16 +154,14 @@ if (m_financeQuoteSources.empty()) { // run the process one time only // since this is a static function it can be called without constructing an object // so we need to make sure that m_financeQuoteScriptPath is properly initialized - if (m_financeQuoteScriptPath.isEmpty()) { - m_financeQuoteScriptPath = KGlobal::dirs()->findResource("appdata", - QString("financequote.pl")); - } - AlkFinanceQuoteProcess getList; - getList.launch(m_financeQuoteScriptPath); - while (!getList.isFinished()) { - qApp->processEvents(); + if (setupFinanceQuoteScriptPath()) { + AlkFinanceQuoteProcess getList; + getList.launch(m_financeQuoteScriptPath); + while (!getList.isFinished()) { + qApp->processEvents(); + } + m_financeQuoteSources = getList.getSourceList(); } - m_financeQuoteSources = getList.getSourceList(); } return m_financeQuoteSources; } @@ -161,10 +174,14 @@ const QStringList quoteSourcesGHNS() { QStringList sources; - QString relPath = m_GHNSFilePath; - - foreach (const QString &file, - KStandardDirs().findAllResources("data", relPath + QString::fromLatin1("/*.txt"))) { + const QString filename = QString("%1/*.txt").arg(m_GHNSFilePath); + +#if QT_VERSION >= QT_VERSION_CHECK(5,0,0) + const auto resources = QStandardPaths::locateAll(QStandardPaths::DataLocation, filename); +#else + const QStringList resources = KStandardDirs().findAllResources("data", filename); +#endif + foreach (const QString &file, resources) { QFileInfo f(file); QString file2 = f.completeBaseName(); AlkOnlineQuoteSource source(file2, m_p); @@ -288,7 +305,11 @@ QString AlkOnlineQuotesProfile::hotNewStuffConfigFile() const { +#if QT_VERSION >= QT_VERSION_CHECK(5,0,0) + QString configFile = QStandardPaths::locate(QStandardPaths::AppConfigLocation, d->m_GHNSFile); +#else QString configFile = KStandardDirs::locate("config", d->m_GHNSFile); +#endif if (configFile.isEmpty()) { configFile = QString("%1/%2").arg(KNSRC_DIR, d->m_GHNSFile); } diff --git a/src/alkonlinequoteswidget.cpp b/src/alkonlinequoteswidget.cpp --- a/src/alkonlinequoteswidget.cpp +++ b/src/alkonlinequoteswidget.cpp @@ -31,15 +31,28 @@ #include #include -#include -#include -#include +#if QT_VERSION >= QT_VERSION_CHECK(5,0,0) + #include + #include + #include + #include + #define KIcon QIcon +#else + #include + #include + #include + #include + #include +#endif + #include #include -#include -#include -#include +#if QT_VERSION >= QT_VERSION_CHECK(5,0,0) + #include +#else + #include +#endif class AlkOnlineQuotesWidget::Private : public QWidget, public Ui::AlkOnlineQuotesWidget { @@ -122,31 +135,40 @@ KIcon("dialog-ok"), i18n("Accepts the entered data and stores it"), i18n("Use this to accept the modified data.")); - m_updateButton->setGuiItem(updateButtenItem); KGuiItem deleteButtenItem(i18n("&Delete"), KIcon("edit-delete"), i18n("Delete the selected source entry"), i18n("Use this to delete the selected online source entry")); - m_deleteButton->setGuiItem(deleteButtenItem); KGuiItem checkButtonItem(i18nc("Check the selected source entry", "&Check Source"), KIcon("document-edit-verify"), i18n("Check the selected source entry"), i18n("Use this to check the selected online source entry")); - m_checkButton->setGuiItem(checkButtonItem); KGuiItem showButtonItem(i18nc("Show the selected source entry in a web browser", "&Show page"), KIcon("applications-internet"), i18n("Show the selected source entry in a web browser"), i18n("Use this to show the selected online source entry")); - m_showButton->setGuiItem(showButtonItem); KGuiItem newButtenItem(i18nc("Create a new source entry for online quotes", "&New..."), KIcon("document-new"), i18n("Create a new source entry for online quotes"), i18n("Use this to create a new entry for online quotes")); + +#if QT_VERSION >= QT_VERSION_CHECK(5,0,0) + KGuiItem::assign(m_updateButton, updateButtenItem); + KGuiItem::assign(m_deleteButton, deleteButtenItem); + KGuiItem::assign(m_checkButton, checkButtonItem); + KGuiItem::assign(m_showButton, showButtonItem); + KGuiItem::assign(m_newButton, newButtenItem); +#else + m_updateButton->setGuiItem(updateButtenItem); + m_deleteButton->setGuiItem(deleteButtenItem); + m_checkButton->setGuiItem(checkButtonItem); + m_showButton->setGuiItem(showButtonItem); m_newButton->setGuiItem(newButtenItem); +#endif connect(m_newProfile, SIGNAL(clicked()), this, SLOT(slotNewProfile())); connect(m_deleteProfile, SIGNAL(clicked()), this, SLOT(slotDeleteProfile())); diff --git a/src/alkonlinequoteswidget5.ui b/src/alkonlinequoteswidget5.ui new file mode 100644 --- /dev/null +++ b/src/alkonlinequoteswidget5.ui @@ -0,0 +1,579 @@ + + + AlkOnlineQuotesWidget + + + + 0 + 0 + 523 + 879 + + + + + 0 + 0 + + + + Online Quotes + + + + + + <html><head/><body><p>Select, add or delete an application profile, where to load profiles from and save into eg. kmymoney or skrooge.</p></body></html> + + + Application Profiles + + + Qt::AlignCenter + + + + + + + + + + + + + false + + + New + + + + + + + false + + + Delete + + + + + + + Qt::Vertical + + + + 20 + 40 + + + + + + + + + + + + + + + Profile details + + + Qt::AlignCenter + + + + + + GHNS config file + + + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + Config file + + + + + + + + + + Qt::LinksAccessibleByMouse|Qt::TextSelectableByMouse + + + + + + + + + + Qt::LinksAccessibleByMouse|Qt::TextSelectableByMouse + + + + + + + + + + Qt::LinksAccessibleByMouse|Qt::TextSelectableByMouse + + + + + + + GHNS data path + + + + + + + Qt::Vertical + + + + 20 + 40 + + + + + + + + + + + true + + + <html><head/><body><p>online price quotes</p></body></html> + + + Online Quotes + + + Qt::AlignCenter + + + + + + + + + + + + + New + + + + + + + Delete + + + + + + + Create a duplicate of the currently selected source entry under a different name. + + + Use this to create a duplicate of an entry for an online source + + + Duplicate + + + + .. + + + + + + + Install + + + + + + + Upload + + + + + + + Qt::Vertical + + + + 14 + 13 + + + + + + + + + + + + + + + <html><head/><body><p><span style=" font-style:italic;">Enter regular expressions which can be used to parse the data returned from the URL entered above. The symbol, price, and date must be found in the quote data to be usable. You may also try the KMyMoney forum at </span><a href="https://forum.kde.org/viewforum.php?f=69"><span style=" text-decoration: underline; color:#2980b9;">https://forum.kde.org/viewforum.php?f=69</span></a> or the <span style=" font-style:italic;">user's mailinglist at </span><a href="mailto:kmymoney@kde.org"><span style=" font-style:italic; text-decoration: underline; color:#2980b9;">kmymoney@kde.org</span></a><span style=" font-style:italic;"> to find what settings work for other users in your country.</span></p></body></html> + + + Details + + + Qt::AlignCenter + + + + + + + + + + Regular Expression to extract the date from the downloaded data + + + + + + + Date Format + + + false + + + + + + + + + + + + + + Regular Expression to extract the symbol from the downloaded data + + + + + + + Date + + + false + + + + + + + <p>For easier processing of the data returned by the online source, KMyMoney usually strips unused parts before it is parsed with the regular expressions. If matching of the fields relies on those items, then use this option to turn stripping off.</p> + +<p>The following items are usually removed by stripping: + +<ul> +<li>HTML tags such as <b>&lt;tag&gt;</b></li> +<li>& encoded characters such as <b>&amp;nbsp;</b></li> +<li>duplicate whitespace</li> +</ul> +</p> + + + Skip HTML stripping + + + + + + + + + + + + + + + + + + + + + URL + + + false + + + + + + + Regular Expression to extract the price from the downloaded data + + + + + + + Options + + + + + + + + + + GHNS Source + + + + + + + + + + + + + + + + + + + + + Price + + + false + + + + + + + Symbol + + + false + + + + + + + Regular Expression to extract the date from the downloaded data + + + + + + + URL to be used to download the quote + + + Enter the URL from which stock quotes will be fetched. <b>%1</b> will be replaced with the symbol for the security being quoted. For currency conversions, <b>%2</b> will be replaced with the currency to be quoted and <b>%1</b> with the currency the quote is based on. + + + + + + + + + 0 + + + + + Accept + + + + + + + Qt::Vertical + + + + 20 + 40 + + + + + + + + + + + + Qt::Vertical + + + + 20 + 40 + + + + + + + + + + + Debugging + + + Qt::AlignCenter + + + + + + + + + + + + One Symbol + + + + + + + + + + + + + + Two Symbols + + + + + + + + + + + + + + + + + + + + + Check Source + + + + + + + Show Page + + + + + + + Qt::Vertical + + + + 20 + 40 + + + + + + + + + + + + + + + KTextEdit + QTextEdit +
ktextedit.h
+
+ + KLineEdit + QLineEdit +
klineedit.h
+
+
+ + +
diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt --- a/tests/CMakeLists.txt +++ b/tests/CMakeLists.txt @@ -15,7 +15,6 @@ list(APPEND TEST_LIB ${QT_USE_LIBSPREFIX}Qml ${QT_USE_LIBSPREFIX}WebKitWidgets - KF5::KDELibs4Support ) endif() add_executable(qmlalkonlinequotetest diff --git a/tests/alkonlinequoteswidgettest.cpp b/tests/alkonlinequoteswidgettest.cpp --- a/tests/alkonlinequoteswidgettest.cpp +++ b/tests/alkonlinequoteswidgettest.cpp @@ -1,5 +1,6 @@ /*************************************************************************** * Copyright 2019 Ralf Habacker ralf.habacker@freenet.de * + * Copyright 2019 Thomas Baumgart * * * * This file is part of libalkimia. * * * @@ -21,17 +22,17 @@ #include "alkonlinequotesprofile.h" #include "alkonlinequotesprofilemanager.h" -#include #if QT_VERSION >= QT_VERSION_CHECK(5,0,0) -#include + #include #else -#include -class QGuiApplication : public QApplication -{ -public: - QGuiApplication(int &argc, char **argv) : QApplication(argc, argv) {} -}; + #include + #include + class QGuiApplication : public QApplication + { + public: + QGuiApplication(int &argc, char **argv) : QApplication(argc, argv) {} + }; #endif #include diff --git a/tools/onlinequoteseditor/CMakeLists.txt b/tools/onlinequoteseditor/CMakeLists.txt --- a/tools/onlinequoteseditor/CMakeLists.txt +++ b/tools/onlinequoteseditor/CMakeLists.txt @@ -13,19 +13,30 @@ ) set(UI - mainwindow.ui + mainwindow.ui ) ki18n_wrap_ui(SOURCES ${UI} ) #kde4_add_app_icon(SOURCES "${KDE4_INSTALL_DIR}/share/icons/oxygen/*/actions/application-exit.png") ecm_add_executable(onlinequoteseditor ${SOURCES} ${HEADERS}) if(BUILD_QT4) - set(LIBS ${KDE4_KDECORE_LIBS} ${KDE4_KDEUI_LIBS} ${QT_USE_LIBSPREFIX}Core ${QT_USE_LIBSPREFIX}Network ${QT_USE_LIBSPREFIX}WebKit) + set(LIBS + ${KDE4_KDECORE_LIBS} + ${KDE4_KDEUI_LIBS} + ${QT_USE_LIBSPREFIX}Core + ${QT_USE_LIBSPREFIX}Network + ${QT_USE_LIBSPREFIX}WebKit + ) else() - set(LIBS Qt5::Widgets Qt5::WebKitWidgets KF5::KDELibs4Support) - add_definitions(-DTRANSLATION_DOMAIN=\"onlinequoteeditor\") + set(LIBS + Qt5::Widgets + Qt5::WebKitWidgets + KF5::CoreAddons + KF5::I18n + ) + add_definitions(-DTRANSLATION_DOMAIN=\"onlinequoteseditor\") endif() target_link_libraries(onlinequoteseditor diff --git a/tools/onlinequoteseditor/main.cpp b/tools/onlinequoteseditor/main.cpp --- a/tools/onlinequoteseditor/main.cpp +++ b/tools/onlinequoteseditor/main.cpp @@ -1,5 +1,6 @@ /*************************************************************************** * Copyright 2018 Ralf Habacker * + * Copyright 2019 Thomas Baumgart * * * * This file is part of libalkimia. * * * @@ -19,29 +20,41 @@ #include "mainwindow.h" +#include #if QT_VERSION >= QT_VERSION_CHECK(5,0,0) -#define KABOUTDATA_H -#include -#define KAboutData K4AboutData + #include + #include #else -#include + #include + #include #endif -#include -#include int main(int argc, char **argv) { +#if QT_VERSION >= QT_VERSION_CHECK(5,0,0) + KAboutData about(QStringLiteral("onlinequoteseditor"), + i18n("onlinequoteseditor"), + QStringLiteral("1.0"), + i18n("Editor for online price quotes used by finance applications"), + KAboutLicense::GPL, + i18n("(C) 2018 Ralf Habacker")); + QApplication app(argc,argv); + +#else + KAboutData about("onlinequoteseditor", "onlinequoteeditor", ki18n("onlinequoteseditor"), "1.0", ki18n("Editor for online price quotes used by finance applications"), KAboutData::License_GPL, ki18n("(C) 2018 Ralf Habacker")); + KCmdLineArgs::init(argc, argv, &about); KApplication app(true); +#endif MainWindow w; w.show(); diff --git a/tools/onlinequoteseditor/mainwindow.cpp b/tools/onlinequoteseditor/mainwindow.cpp --- a/tools/onlinequoteseditor/mainwindow.cpp +++ b/tools/onlinequoteseditor/mainwindow.cpp @@ -81,7 +81,9 @@ manager.addProfile(new AlkOnlineQuotesProfile("kmymoney4", AlkOnlineQuotesProfile::Type::KMyMoney4, "kmymoney-quotes.knsrc")); manager.addProfile(new AlkOnlineQuotesProfile("kmymoney5", AlkOnlineQuotesProfile::Type::KMyMoney5, "kmymoney-quotes.knsrc")); d->ui.setupUi(this); - +#if QT_VERSION >= QT_VERSION_CHECK(5,0,0) + d->ui.mainToolBar->deleteLater(); +#endif d->quotesWidget = new AlkOnlineQuotesWidget(true, true); QDockWidget *profilesWidget = new QDockWidget(tr("Profiles"), this);