void Activities::Private::loadLastActivity() { // This is called from constructor, no need for locking // If there are no public activities, try to load the last used activity const auto lastUsedActivity = mainConfig().readEntry("currentActivity", QString()); setCurrentActivity( (lastUsedActivity.isEmpty() && activities.size() > 0) ? activities.keys().at(0) : lastUsedActivity); }
void GUI::loadState(KSharedConfigPtr cfg) { setAutoSaveSettings("MainWindow", true); central->loadState(cfg); torrent_activity->loadState(cfg); KConfigGroup g = cfg->group("MainWindow"); bool statusbar_hidden = g.readEntry("statusbar_hidden", false); status_bar->setHidden(statusbar_hidden); show_status_bar_action->setChecked(!statusbar_hidden); bool menubar_hidden = g.readEntry("menubar_hidden", false); menuBar()->setHidden(menubar_hidden); show_menu_bar_action->setChecked(!menubar_hidden); bool hidden_on_exit = g.readEntry("hidden_on_exit", false); if (Settings::showSystemTrayIcon()) { if (hidden_on_exit) { Out(SYS_GEN | LOG_DEBUG) << "Starting minimized" << endl; hide(); } else { show(); } } else { show(); } setCurrentActivity(central->currentActivity()); }