diff --git a/src/mainwindow.cpp b/src/mainwindow.cpp index 7d71391..9546123 100644 --- a/src/mainwindow.cpp +++ b/src/mainwindow.cpp @@ -71,40 +71,38 @@ namespace Danbooru { i18n("Connect..."), this); - KAction* fetch = new KAction(KIcon(QLatin1String("download")), + KAction* fetchAction = new KAction(KIcon(QLatin1String("download")), i18n("Download"), this); connectAction->setShortcut(KStandardShortcut::open()); - fetch->setShortcut(KStandardShortcut::find()); - fetch->setEnabled(false); + fetchAction->setShortcut(KStandardShortcut::find()); + fetchAction->setEnabled(false); actionCollection()->addAction(QLatin1String("connect"), connectAction); - actionCollection()->addAction(QLatin1String("fetch"), fetch); + actionCollection()->addAction(QLatin1String("fetch"), fetchAction); // actionCollection()->removeAction(actionCollection()->action("help_contents")); - // KStandardAction::openNew(this, SLOT(fileNew()), actionCollection()); - KStandardAction::quit(qApp, SLOT(close()), actionCollection()); - connect(connectAction, SIGNAL(triggered(bool)), this, SLOT(connectToBoard())); + connect(connectAction, SIGNAL(triggered(bool)), this, + SLOT(connectToBoard())); connect(fetch, SIGNAL(triggered(bool)), this, SLOT(downloadPosts())); - // - // KStandardAction::preferences(this, SLOT(optionsPreferences()), actionCollection()); - // - // // custom menu and menu item - the slot is in the class DanbooruMainWindowView - // KAction *custom = new KAction(KIcon("colorize"), i18n("Swi&tch Colors"), this); - // actionCollection()->addAction( QLatin1String("switch_action"), custom ); - // connect(custom, SIGNAL(triggered(bool)), m_view, SLOT(switchColors())); } void DanbooruMainWindow::connectToBoard() { + if (!m_view) { + return; + } + } void DanbooruMainWindow::downloadPosts() { - + if (!m_service) { + return; + } } void DanbooruMainWindow::optionsPreferences()