From 4141a5f0742213630a18c455415d43f0a52f0052 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebastian=20K=C3=BCgler?= Date: Mon, 22 Jul 2013 16:59:40 +0200 Subject: [PATCH 1/6] Update types API --- .../testcomponentsapplet/contents/ui/DialogContent.qml | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/shell/applets/testcomponentsapplet/contents/ui/DialogContent.qml b/src/shell/applets/testcomponentsapplet/contents/ui/DialogContent.qml index e99ca467f..9fed86d33 100644 --- a/src/shell/applets/testcomponentsapplet/contents/ui/DialogContent.qml +++ b/src/shell/applets/testcomponentsapplet/contents/ui/DialogContent.qml @@ -48,11 +48,11 @@ Item { id: localeItem anchors { left: parent.left; right: parent.right; top: tx.bottom; } } -// PlasmaComponents.TextArea { -// anchors { left: parent.left; right: parent.right; top: localeItem.bottom; } -// width: parent.width -// height: 80 -// } + PlasmaComponents.TextArea { + anchors { left: parent.left; right: parent.right; top: localeItem.bottom; } + width: parent.width + height: 80 + } PlasmaComponents.Button { id: thanks anchors { horizontalCenter: parent.horizontalCenter; bottom: parent.bottom; bottomMargin: 24; } From ec2930251512af520835781f91663ba9fe080005 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebastian=20K=C3=BCgler?= Date: Mon, 22 Jul 2013 17:00:02 +0200 Subject: [PATCH 2/6] Update types API --- .../contents/ui/DialogsPage.qml | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/src/shell/applets/testcomponentsapplet/contents/ui/DialogsPage.qml b/src/shell/applets/testcomponentsapplet/contents/ui/DialogsPage.qml index a698901fb..27c006d4d 100644 --- a/src/shell/applets/testcomponentsapplet/contents/ui/DialogsPage.qml +++ b/src/shell/applets/testcomponentsapplet/contents/ui/DialogsPage.qml @@ -180,7 +180,7 @@ PlasmaComponents.Page { width: _h text: "Top" onClicked: { - locationDialog.location = PlasmaCore.Plasma.TopEdge; + locationDialog.location = PlasmaCore.Types.TopEdge; locationDialog.visible = !locationDialog.visible } } @@ -188,7 +188,7 @@ PlasmaComponents.Page { text: "Bottom" width: _h onClicked: { - locationDialog.location = PlasmaCore.Plasma.BottomEdge; + locationDialog.location = PlasmaCore.Types.BottomEdge; locationDialog.visible = !locationDialog.visible } } @@ -196,7 +196,7 @@ PlasmaComponents.Page { text: "Left" width: _h onClicked: { - locationDialog.location = PlasmaCore.Plasma.LeftEdge; + locationDialog.location = PlasmaCore.Types.LeftEdge; locationDialog.visible = !locationDialog.visible } } @@ -204,7 +204,7 @@ PlasmaComponents.Page { text: "Right" width: _h onClicked: { - locationDialog.location = PlasmaCore.Plasma.RightEdge; + locationDialog.location = PlasmaCore.Types.RightEdge; locationDialog.visible = !locationDialog.visible } } @@ -212,7 +212,7 @@ PlasmaComponents.Page { text: "Desktop" width: _h onClicked: { - locationDialog.location = PlasmaCore.Plasma.Desktop; + locationDialog.location = PlasmaCore.Types.Desktop; locationDialog.visible = !locationDialog.visible } } @@ -220,7 +220,7 @@ PlasmaComponents.Page { text: "Floating" width: _h onClicked: { - locationDialog.location = PlasmaCore.Plasma.Floating; + locationDialog.location = PlasmaCore.Types.Floating; locationDialog.visible = !locationDialog.visible } } @@ -228,7 +228,7 @@ PlasmaComponents.Page { text: "FullScreen" width: _h onClicked: { - locationDialog.location = PlasmaCore.Plasma.FullScreen; + locationDialog.location = PlasmaCore.Types.FullScreen; locationDialog.visible = !locationDialog.visible } } From 07df8225d8b081ca41d9c22d39028dc668fb4ccb Mon Sep 17 00:00:00 2001 From: l10n daemon script Date: Tue, 23 Jul 2013 04:05:37 +0000 Subject: [PATCH 3/6] SVN_SILENT made messages (.desktop file) --- src/plasma/data/servicetypes/plasma-generic.desktop | 2 ++ src/platformstatus/kded_platformstatus.desktop | 2 ++ 2 files changed, 4 insertions(+) diff --git a/src/plasma/data/servicetypes/plasma-generic.desktop b/src/plasma/data/servicetypes/plasma-generic.desktop index 0db3357c7..315148f93 100644 --- a/src/plasma/data/servicetypes/plasma-generic.desktop +++ b/src/plasma/data/servicetypes/plasma-generic.desktop @@ -5,6 +5,7 @@ Name=Plasma Package Name[cs]=Balíček Plasmy Name[de]=Plasma-Paket Name[fi]=Plasma-paketti +Name[fr]=Paquet Plasma Name[nl]=Plasma-pakket Name[pt]=Pacote do Plasma Name[pt_BR]=Pacote do Plasma @@ -14,6 +15,7 @@ Name[uk]=Пакунок Плазми Name[x-test]=xxPlasma Packagexx Comment=Generic Plasma Package Comment[de]=Allgemeines Plasma-Paket +Comment[fr]=Paquet Plasma générique Comment[nl]=Algemeen plasma-pakket Comment[pt]=Pacote Genérico do Plasma Comment[pt_BR]=Pacote genérico do Plasma diff --git a/src/platformstatus/kded_platformstatus.desktop b/src/platformstatus/kded_platformstatus.desktop index fc90c9d66..351af0640 100644 --- a/src/platformstatus/kded_platformstatus.desktop +++ b/src/platformstatus/kded_platformstatus.desktop @@ -6,6 +6,7 @@ X-KDE-DBus-ModuleName=plaformstatus X-KDE-Kded-autoload=true X-KDE-Kded-load-on-demand=false Name=Platform Status +Name[fr]=État de la plate-forme Name[nl]=Status van platform Name[pt]=Estado da Plataforma Name[pt_BR]=Status da plataforma @@ -14,6 +15,7 @@ Name[sv]=Plattformstatus Name[uk]=Стан платформи Name[x-test]=xxPlatform Statusxx Comment=Tracks the current shell package and the platform definition strings. +Comment[fr]=Suit le paquet du terminal actuel et les chaînes de définition de la plate-forme. Comment[nl]=Volgt het huidige shell-pakket en de definitietekenreeksen van platform. Comment[pt]=Segue o pacote da consola actual e a os textos de definição da plataforma. Comment[pt_BR]=Segue o pacote do shell atual e as strings de definição da plataforma. From 39cd64fc68b1dc2fc06f308e73ec5be1c78d28f6 Mon Sep 17 00:00:00 2001 From: Kevin Ottens Date: Mon, 22 Jul 2013 13:21:56 +0200 Subject: [PATCH 4/6] Revert "Revert "Enabling C++11 flags for clang and gcc"" This reverts commit 597397b41f5450f24ddc784e0faa13133fed6bd5. Reverting my own revert now that we have proper consensus on what one can use of C++11 in KF5. For reference: http://community.kde.org/Frameworks/Policies#Frameworks_compiler_requirements_and_C.2B.2B11 We probably want that properly done within CMake or E-C-M though. CCMAIL: plasma-devel@kde.org CCMAIL: kde-frameworks-devel@kde.org --- CMakeLists.txt | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/CMakeLists.txt b/CMakeLists.txt index d4d0a4335..4ca55c996 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -40,6 +40,12 @@ endif() # in the KDE build system, this is the same as CMAKE_BINARY_DIR. configure_file(${CMAKE_SOURCE_DIR}/CTestCustom.cmake ${CMAKE_BINARY_DIR}/CTestCustom.cmake COPYONLY) +################# Enable C++11 features for clang and gcc ################# + +if(UNIX) + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -std=c++0x") +endif() + ################# now find all used packages ################# set (QT_MIN_VERSION "5.2.0") From 20b9d17e4c594765c190bfe3213ee192235db4cf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20Gr=C3=A4=C3=9Flin?= Date: Thu, 25 Jul 2013 06:58:21 +0200 Subject: [PATCH 5/6] Adjust RunnerManager to new ThreadWeaver API using JobPointer ThreadWeaver does not use Job* anymore which made the code compile fail and some connects being wrong. This patch adjusts RunnerManager to also use QSharedPointer instead of FindMatchJob*. It simplifies a few things as we do no longer have to call e.g. qDeleteAll and fixes the incorrect connects. REVIEW: 111650 --- src/plasma/private/runnerjobs.cpp | 11 ++++---- src/plasma/private/runnerjobs_p.h | 6 ++-- src/plasma/runnermanager.cpp | 47 ++++++++++++++++--------------- src/plasma/runnermanager.h | 2 +- 4 files changed, 34 insertions(+), 32 deletions(-) diff --git a/src/plasma/private/runnerjobs.cpp b/src/plasma/private/runnerjobs.cpp index a012a6cbb..c21f5cdd4 100644 --- a/src/plasma/private/runnerjobs.cpp +++ b/src/plasma/private/runnerjobs.cpp @@ -170,7 +170,7 @@ Plasma::AbstractRunner* FindMatchesJob::runner() const return m_runner; } -DelayedJobCleaner::DelayedJobCleaner(const QSet &jobs, const QSet &runners) +DelayedJobCleaner::DelayedJobCleaner(const QSet > &jobs, const QSet &runners) : QObject(Weaver::instance()), m_weaver(Weaver::instance()), m_jobs(jobs), @@ -178,8 +178,8 @@ DelayedJobCleaner::DelayedJobCleaner(const QSet &jobs, const Q { connect(m_weaver, SIGNAL(finished()), this, SLOT(checkIfFinished())); - foreach (FindMatchesJob *job, m_jobs) { - connect(job, SIGNAL(done(ThreadWeaver::Job*)), this, SLOT(jobDone(ThreadWeaver::Job*))); + for (auto it = m_jobs.constBegin(); it != m_jobs.constEnd(); ++it) { + connect((*it).data(), &Job::done, this, &DelayedJobCleaner::jobDone); } } @@ -188,9 +188,9 @@ DelayedJobCleaner::~DelayedJobCleaner() qDeleteAll(m_runners); } -void DelayedJobCleaner::jobDone(ThreadWeaver::Job *job) +void DelayedJobCleaner::jobDone(ThreadWeaver::JobPointer job) { - FindMatchesJob *runJob = dynamic_cast(job); + auto runJob = job.dynamicCast(); if (!runJob) { return; @@ -207,7 +207,6 @@ void DelayedJobCleaner::jobDone(ThreadWeaver::Job *job) void DelayedJobCleaner::checkIfFinished() { if (m_weaver->isIdle()) { - qDeleteAll(m_jobs); m_jobs.clear(); deleteLater(); } diff --git a/src/plasma/private/runnerjobs_p.h b/src/plasma/private/runnerjobs_p.h index cf053248e..7fd707698 100644 --- a/src/plasma/private/runnerjobs_p.h +++ b/src/plasma/private/runnerjobs_p.h @@ -127,16 +127,16 @@ private: class DelayedJobCleaner : public QObject { public: - DelayedJobCleaner(const QSet &jobs, const QSet &runners = QSet()); + DelayedJobCleaner(const QSet > &jobs, const QSet &runners = QSet()); ~DelayedJobCleaner(); private Q_SLOTS: - void jobDone(ThreadWeaver::Job*); + void jobDone(ThreadWeaver::JobPointer); void checkIfFinished(); private: ThreadWeaver::Weaver *m_weaver; - QSet m_jobs; + QSet > m_jobs; QSet m_runners; }; diff --git a/src/plasma/runnermanager.cpp b/src/plasma/runnermanager.cpp index 46857f461..c2919eb40 100644 --- a/src/plasma/runnermanager.cpp +++ b/src/plasma/runnermanager.cpp @@ -231,19 +231,27 @@ public: } if (!deadRunners.isEmpty()) { - QSet deadJobs; - foreach (FindMatchesJob *job, searchJobs) { + QSet > deadJobs; + auto it = searchJobs.begin(); + while (it != searchJobs.end()) { + auto &job = (*it); if (deadRunners.contains(job->runner())) { - QObject::disconnect(job, SIGNAL(done(ThreadWeaver::Job*)), q, SLOT(jobDone(ThreadWeaver::Job*))); - searchJobs.remove(job); + QObject::disconnect(job.data(), SIGNAL(done(ThreadWeaver::JobPointer)), q, SLOT(jobDone(ThreadWeaver::JobPointer))); + it = searchJobs.erase(it); deadJobs.insert(job); + } else { + it++; } } - foreach (FindMatchesJob *job, oldSearchJobs) { + it = oldSearchJobs.begin(); + while (it != oldSearchJobs.end()) { + auto &job = (*it); if (deadRunners.contains(job->runner())) { - oldSearchJobs.remove(job); + it = oldSearchJobs.erase(it); deadJobs.insert(job); + } else { + it++; } } @@ -309,9 +317,9 @@ public: return runner; } - void jobDone(ThreadWeaver::Job *job) + void jobDone(ThreadWeaver::JobPointer job) { - FindMatchesJob *runJob = dynamic_cast(job); + auto runJob = job.dynamicCast(); if (!runJob) { return; @@ -347,9 +355,7 @@ public: } if (Weaver::instance()->isIdle()) { - qDeleteAll(searchJobs); searchJobs.clear(); - qDeleteAll(oldSearchJobs); oldSearchJobs.clear(); } @@ -381,7 +387,6 @@ public: { // WORKAROUND: Queue an empty job to force ThreadWeaver to awaken threads if (searchJobs.isEmpty() && Weaver::instance()->isIdle()) { - qDeleteAll(oldSearchJobs); oldSearchJobs.clear(); checkTearDown(); return; @@ -408,12 +413,12 @@ public: void startJob(AbstractRunner *runner) { if ((runner->ignoredTypes() & context.type()) == 0) { - FindMatchesJob *job = new FindMatchesJob(runner, &context, Weaver::instance()); - QObject::connect(job, SIGNAL(done(ThreadWeaver::Job*)), q, SLOT(jobDone(ThreadWeaver::Job*))); + QSharedPointer job(new FindMatchesJob(runner, &context, Weaver::instance())); + QObject::connect(job.data(), SIGNAL(done(ThreadWeaver::JobPointer)), q, SLOT(jobDone(ThreadWeaver::JobPointer))); if (runner->speed() == AbstractRunner::SlowSpeed) { job->setDelayTimer(&delayTimer); } - Weaver::instance()->enqueueRaw(job); + Weaver::instance()->enqueue(job); searchJobs.insert(job); } } @@ -429,8 +434,8 @@ public: QHash runners; QHash advertiseSingleRunnerIds; AbstractRunner* currentSingleRunner; - QSet searchJobs; - QSet oldSearchJobs; + QSet > searchJobs; + QSet > oldSearchJobs; KConfigGroup conf; QString singleModeRunnerId; bool loadAll : 1; @@ -615,8 +620,8 @@ void RunnerManager::run(const QueryMatch &match) //TODO: this function is not const as it may be used for learning AbstractRunner *runner = match.runner(); - foreach (FindMatchesJob *job, d->searchJobs) { - if (job->runner() == runner && !job->isFinished()) { + for (auto it = d->searchJobs.constBegin(); it != d->searchJobs.constEnd(); ++it) { + if ((*it)->runner() == runner && !(*it)->isFinished()) { #ifndef NDEBUG kDebug() << "deferred run"; #endif @@ -775,12 +780,10 @@ void RunnerManager::reset() { // If ThreadWeaver is idle, it is safe to clear previous jobs if (Weaver::instance()->isIdle()) { - qDeleteAll(d->searchJobs); - qDeleteAll(d->oldSearchJobs); d->oldSearchJobs.clear(); } else { - Q_FOREACH(FindMatchesJob *job, d->searchJobs) { - Weaver::instance()->dequeueRaw(job); + for (auto it = d->searchJobs.constBegin(); it != d->searchJobs.constEnd(); ++it) { + Weaver::instance()->dequeue((*it)); } d->oldSearchJobs += d->searchJobs; } diff --git a/src/plasma/runnermanager.h b/src/plasma/runnermanager.h index ebeb02925..1963f661f 100644 --- a/src/plasma/runnermanager.h +++ b/src/plasma/runnermanager.h @@ -272,7 +272,7 @@ class PLASMA_EXPORT RunnerManager : public QObject private: Q_PRIVATE_SLOT(d, void scheduleMatchesChanged()) Q_PRIVATE_SLOT(d, void matchesChanged()) - Q_PRIVATE_SLOT(d, void jobDone(ThreadWeaver::Job*)) + Q_PRIVATE_SLOT(d, void jobDone(ThreadWeaver::JobPointer)) Q_PRIVATE_SLOT(d, void unblockJobs()) Q_PRIVATE_SLOT(d, void runnerMatchingSuspended(bool)) From c42406cabcad381e836de6eaea56a39473971337 Mon Sep 17 00:00:00 2001 From: Kevin Ottens Date: Thu, 25 Jul 2013 11:54:15 +0200 Subject: [PATCH 6/6] Pull in the KDE4Attic dependency --- CMakeLists.txt | 3 ++- src/declarativeimports/locale/CMakeLists.txt | 1 + src/plasma/CMakeLists.txt | 3 ++- 3 files changed, 5 insertions(+), 2 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 4ca55c996..a4911e170 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -56,7 +56,8 @@ find_package(kdeqt5staging REQUIRED NO_MODULE) find_package(KF5 MODULE REQUIRED COMPONENTS CMake Compiler InstallDirs KIdleTime ItemModels KWidgetsAddons KWindowSystem KCodecs KArchive KCoreAddons Solid ThreadWeaver KConfig KAuth KJS KWallet KDBusAddons - KI18n KGuiAddons KService KWidgets ItemViews KNotifications KIconThemes KCompletion KJobWidgets KConfigWidgets Sonnet KTextWidgets XmlGui KCrash) + KI18n KGuiAddons KService KWidgets ItemViews KNotifications KIconThemes KCompletion KJobWidgets KConfigWidgets Sonnet KTextWidgets XmlGui KCrash + KIO KUnitConversion KDE4Attic) #find_package(KF5Transitional REQUIRED) # those are not "done" yet: diff --git a/src/declarativeimports/locale/CMakeLists.txt b/src/declarativeimports/locale/CMakeLists.txt index 036baf241..8219f26a1 100644 --- a/src/declarativeimports/locale/CMakeLists.txt +++ b/src/declarativeimports/locale/CMakeLists.txt @@ -20,6 +20,7 @@ target_link_libraries(localebindingsplugin ${Qt5Quick_LIBRARIES} ${Qt5Qml_LIBRARIES} ${KDE4_KDECORE_LIBS} + KF5::KDE4Attic ) install(TARGETS localebindingsplugin DESTINATION ${QML_INSTALL_DIR}/org/kde/locale) install(FILES qmldir DESTINATION ${QML_INSTALL_DIR}/org/kde/locale) diff --git a/src/plasma/CMakeLists.txt b/src/plasma/CMakeLists.txt index 5ae5c1de7..0cccd81fb 100644 --- a/src/plasma/CMakeLists.txt +++ b/src/plasma/CMakeLists.txt @@ -146,8 +146,9 @@ target_link_libraries(plasma ${KAuth_LIBRARIES} ${KWindowSystem_LIBRARIES} ${PLASMA_EXTRA_LIBS} - KI18n + KF5::KI18n ${KDE4Support_LIBRARIES} + KF5::KDE4Attic ) #FIXME gpgme++ is in kdepimlibs, neeeds to be elsewhere target_link_libraries(plasma kdeclarative ${KArchive_LIBRARIES})