From kde-commits Mon Jan 18 22:12:13 2010 From: =?utf-8?q?Aaron=20J=2E=20Seigo?= Date: Mon, 18 Jan 2010 22:12:13 +0000 To: kde-commits Subject: branches/KDE/4.4/kdebase/workspace/plasma/generic/runners/places Message-Id: <1263852733.561296.14486.nullmailer () svn ! kde ! org> X-MARC-Message: https://marc.info/?l=kde-commits&m=126385274121436 SVN commit 1076818 by aseigo: move the pre-creatin of the places model to the ctor rather than on each show; slows start up a bit, but makes showing the interface instant, while still avoiding crashes M +4 -8 placesrunner.cpp M +0 -1 placesrunner.h --- branches/KDE/4.4/kdebase/workspace/plasma/generic/runners/places/placesrunner.cpp #1076817:1076818 @@ -31,20 +31,16 @@ setObjectName("Places"); addSyntax(Plasma::RunnerSyntax(":q:", i18n("Finds file manager locations that match :q:"))); addSyntax(Plasma::RunnerSyntax(i18n("places"), i18n("Lists all file manager locations"))); - connect(this, SIGNAL(prepare()), this, SLOT(prepPlacesModel())); + + // makes sure we have the bookmarks and what not that the places + // model uses set up in the main thread, otherwise crashes ensue + KFilePlacesModel places; } PlacesRunner::~PlacesRunner() { } -void PlacesRunner::prepPlacesModel() -{ - // this may look odd, but this makes sure we have the bookmarks and what not that the places - // model uses set up so we can get instant matches once we get to that point - KFilePlacesModel places; -} - void PlacesRunner::match(Plasma::RunnerContext &context) { const QString term = context.query(); --- branches/KDE/4.4/kdebase/workspace/plasma/generic/runners/places/placesrunner.h #1076817:1076818 @@ -36,7 +36,6 @@ void run(const Plasma::RunnerContext &context, const Plasma::QueryMatch &action); private slots: - void prepPlacesModel(); void setupComplete(QModelIndex, bool); };