Git commit 35bb9cf9e79465d252580615f50b4ce8d34e3d34 by Kurt Hindenburg. Committed on 24/02/2013 at 18:27. Pushed by hindenburg into branch 'master'. Remove the the immature --background-mode option See http://lists.kde.org/?l=3Dkonsole-devel&m=3D135316608321148&w=3D2 for details. FIXED-IN: 4.11 BUG: 310433 M +16 -56 src/Application.cpp M +0 -4 src/Application.h M +0 -3 src/main.cpp http://commits.kde.org/konsole/35bb9cf9e79465d252580615f50b4ce8d34e3d34 diff --git a/src/Application.cpp b/src/Application.cpp index b958479..43fc842 100644 --- a/src/Application.cpp +++ b/src/Application.cpp @@ -46,8 +46,6 @@ Application::Application() : KUniqueApplication() = void Application::init() { - _backgroundInstance =3D 0; - #if defined(Q_WS_MAC) // this ensures that Ctrl and Meta are not swapped, so CTRL-C and frie= nds // will work correctly in the terminal @@ -127,28 +125,22 @@ int Application::newInstance() } } = - // if the background-mode argument is supplied, start the backgrou= nd - // session ( or bring to the front if it already exists ) - if (args->isSet("background-mode")) { - startBackgroundMode(window); - } else { - // Qt constrains top-level windows which have not been manually - // resized (via QWidget::resize()) to a maximum of 2/3rds of t= he - // screen size. - // - // This means that the terminal display might not get the widt= h/ - // height it asks for. To work around this, the widget must be - // manually resized to its sizeHint(). - // - // This problem only affects the first time the application is= run. - // run. After that KMainWindow will have manually resized the - // window to its saved size at this point (so the Qt::WA_Resiz= ed - // attribute will be set) - if (!window->testAttribute(Qt::WA_Resized)) - window->resize(window->sizeHint()); - - window->show(); - } + // Qt constrains top-level windows which have not been manually + // resized (via QWidget::resize()) to a maximum of 2/3rds of the + // screen size. + // + // This means that the terminal display might not get the width/ + // height it asks for. To work around this, the widget must be + // manually resized to its sizeHint(). + // + // This problem only affects the first time the application is run. + // run. After that KMainWindow will have manually resized the + // window to its saved size at this point (so the Qt::WA_Resized + // attribute will be set) + if (!window->testAttribute(Qt::WA_Resized)) + window->resize(window->sizeHint()); + + window->show(); } = firstInstance =3D false; @@ -429,37 +421,5 @@ Profile::Ptr Application::processProfileChangeArgs(KCm= dLineArgs* args, Profile:: } } = -void Application::startBackgroundMode(MainWindow* window) -{ - if (_backgroundInstance) { - return; - } - - KAction* action =3D window->actionCollection()->addAction("toggle-back= ground-window"); - action->setObjectName(QLatin1String("Konsole Background Mode")); - action->setText(i18n("Toggle Background Window")); - action->setGlobalShortcut(KShortcut(QKeySequence(Qt::CTRL + Qt::SHIFT = + Qt::Key_F12))); - - connect(action, SIGNAL(triggered()), - this, SLOT(toggleBackgroundInstance())); - - _backgroundInstance =3D window; -} - -void Application::toggleBackgroundInstance() -{ - Q_ASSERT(_backgroundInstance); - - if (!_backgroundInstance->isVisible()) { - _backgroundInstance->show(); - // ensure that the active terminal display has the focus. Without - // this, an odd problem occurred where the focus widget would chan= ge - // each time the background instance was shown - _backgroundInstance->setFocus(); - } else { - _backgroundInstance->hide(); - } -} - #include "Application.moc" = diff --git a/src/Application.h b/src/Application.h index ae9b1fe..b96b199 100644 --- a/src/Application.h +++ b/src/Application.h @@ -69,13 +69,10 @@ private slots: void createWindow(Profile::Ptr profile , const QString& directory); void detachView(Session* session); = - void toggleBackgroundInstance(); - private: void init(); void listAvailableProfiles(); void listProfilePropertyInfo(); - void startBackgroundMode(MainWindow* window); bool processHelpArgs(KCmdLineArgs* args); MainWindow* processWindowArgs(KCmdLineArgs* args); Profile::Ptr processProfileSelectArgs(KCmdLineArgs* args); @@ -84,7 +81,6 @@ private: void createTabFromArgs(KCmdLineArgs* args, MainWindow* window, const QHash&); = - MainWindow* _backgroundInstance; }; } #endif // APPLICATION_H diff --git a/src/main.cpp b/src/main.cpp index 67a52f6..0468cc6 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -168,9 +168,6 @@ void fillCommandLineOptions(KCmdLineOptions& options) options.add("tabs-from-file ", ki18nc("@info:shell", "Create tabs as specified in given t= abs configuration" " file")); - options.add("background-mode", - ki18nc("@info:shell", "Start Konsole in the background and= bring to the front" - " when Ctrl+Shift+F12 (by default) is pressed")); options.add("show-menubar", ki18nc("@info:shell", "Show the menubar, o= verriding the default setting")); options.add("hide-menubar", ki18nc("@info:shell", "Hide the menubar, o= verriding the default setting")); options.add("show-tabbar", ki18nc("@info:shell", "Show the tabbar, ove= rriding the default setting"));