Changeset View
Changeset View
Standalone View
Standalone View
kcms/runners/kcm.cpp
Show All 32 Lines | |||||
33 | 33 | | |||
34 | #include <QApplication> | 34 | #include <QApplication> | ||
35 | #include <QVBoxLayout> | 35 | #include <QVBoxLayout> | ||
36 | #include <QLabel> | 36 | #include <QLabel> | ||
37 | #include <QDialog> | 37 | #include <QDialog> | ||
38 | #include <QDialogButtonBox> | 38 | #include <QDialogButtonBox> | ||
39 | #include <QPainter> | 39 | #include <QPainter> | ||
40 | #include <QPushButton> | 40 | #include <QPushButton> | ||
41 | #include <QTimer> | ||||
ngraham: Don't need to include `QTimer` anymore. | |||||
jayeshbhoot: Fixed | |||||
41 | 42 | | |||
42 | K_PLUGIN_FACTORY(SearchConfigModuleFactory, registerPlugin<SearchConfigModule>();) | 43 | K_PLUGIN_FACTORY(SearchConfigModuleFactory, registerPlugin<SearchConfigModule>();) | ||
43 | 44 | | |||
44 | 45 | | |||
45 | SearchConfigModule::SearchConfigModule(QWidget* parent, const QVariantList& args) | 46 | SearchConfigModule::SearchConfigModule(QWidget* parent, const QVariantList& args) | ||
46 | : KCModule(parent, args) | 47 | : KCModule(parent, args) | ||
47 | , m_config("krunnerrc") | 48 | , m_config("krunnerrc") | ||
48 | { | 49 | { | ||
Show All 28 Lines | |||||
77 | connect(m_pluginSelector, SIGNAL(changed(bool)), | 78 | connect(m_pluginSelector, SIGNAL(changed(bool)), | ||
78 | this, SIGNAL(changed(bool))); | 79 | this, SIGNAL(changed(bool))); | ||
79 | 80 | | |||
80 | layout->addLayout(headerLayout); | 81 | layout->addLayout(headerLayout); | ||
81 | layout->addWidget(m_pluginSelector); | 82 | layout->addWidget(m_pluginSelector); | ||
82 | 83 | | |||
83 | Plasma::RunnerManager *manager = new Plasma::RunnerManager(this); | 84 | Plasma::RunnerManager *manager = new Plasma::RunnerManager(this); | ||
84 | manager->reloadConfiguration(); | 85 | manager->reloadConfiguration(); | ||
86 | | ||||
87 | // Set focus on the pluginselector to focus on search bar. | ||||
88 | // m_pluginSelector->setFocus() did not work. I dont know why. | ||||
89 | QTimer::singleShot(0, m_pluginSelector, SLOT(setFocus())); | ||||
I'm not thrilled about this workaround. Any chance you can figure out why m_pluginSelector->setFocus() doesn't work all on its own? Also, don't use first-person comments in code. ngraham: I'm not thrilled about this workaround. Any chance you can figure out why `m_pluginSelector… | |||||
My guess is parent class KCModule somehow messes up the setFocus() call in constructor. I can't be sure though; not enough knowledge on the codebase yet. But only that seems to explain the focus shifting to Defaults button in the module. My bad on the first-person comment. Fixed. jayeshbhoot: My guess is parent class KCModule somehow messes up the setFocus() call in constructor. I can't… | |||||
85 | } | 90 | } | ||
86 | 91 | | |||
87 | void SearchConfigModule::load() | 92 | void SearchConfigModule::load() | ||
88 | { | 93 | { | ||
89 | m_pluginSelector->addPlugins(Plasma::RunnerManager::listRunnerInfo(), | 94 | m_pluginSelector->addPlugins(Plasma::RunnerManager::listRunnerInfo(), | ||
90 | KPluginSelector::ReadConfigFile, | 95 | KPluginSelector::ReadConfigFile, | ||
91 | i18n("Available Plugins"), QString(), | 96 | i18n("Available Plugins"), QString(), | ||
92 | KSharedConfig::openConfig(QLatin1String( "krunnerrc" ))); | 97 | KSharedConfig::openConfig(QLatin1String( "krunnerrc" ))); | ||
Show All 13 Lines |
Don't need to include QTimer anymore.