diff --git a/Browser/GeoPositionPage.cpp b/Browser/GeoPositionPage.cpp index dde3291b..342bef13 100644 --- a/Browser/GeoPositionPage.cpp +++ b/Browser/GeoPositionPage.cpp @@ -1,89 +1,89 @@ -/* Copyright (C) 2003-2018 Jesper K. Pedersen +/* Copyright (C) 2003-2019 The KPhotoAlbum Development Team This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; see the file COPYING. If not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #include "GeoPositionPage.h" #include "BrowserWidget.h" #include "ImageViewPage.h" #include "OverviewPage.h" #include "enums.h" #include #include #include #include Browser::GeoPositionPage::GeoPositionPage(const DB::ImageSearchInfo &info, BrowserWidget *browser) : BrowserPage(info, browser) { - active = false; + m_active = false; } void Browser::GeoPositionPage::activate() { - if (!active) { + if (!m_active) { MainWindow::Window::theMainWindow()->showPositionBrowser(); Browser::PositionBrowserWidget *positionBrowserWidget = MainWindow::Window::theMainWindow()->positionBrowserWidget(); positionBrowserWidget->showImages(searchInfo()); connect(positionBrowserWidget, &Browser::PositionBrowserWidget::signalNewRegionSelected, this, &GeoPositionPage::slotNewRegionSelected); - active = true; + m_active = true; } } void Browser::GeoPositionPage::deactivate() { - if (active) { - active = false; + if (m_active) { + m_active = false; Browser::PositionBrowserWidget *positionBrowserWidget = MainWindow::Window::theMainWindow()->positionBrowserWidget(); positionBrowserWidget->clearImages(); positionBrowserWidget->disconnect(this); } } void Browser::GeoPositionPage::slotNewRegionSelected(Map::GeoCoordinates::Pair coordinates) { const QString name = i18n("Geo position"); DB::ImageSearchInfo info = searchInfo(); info.setRegionSelection(coordinates); browser()->addAction(new Browser::OverviewPage(Breadcrumb(name), info, browser())); if (DB::ImageDB::instance()->search(info).size() <= Settings::SettingsData::instance()->autoShowThumbnailView()) { browser()->addAction(new ImageViewPage(info, browser())); } } Browser::Viewer Browser::GeoPositionPage::viewer() { return ShowGeoPositionViewer; } bool Browser::GeoPositionPage::isSearchable() const { return false; } bool Browser::GeoPositionPage::showDuringMovement() const { return true; } // vi:expandtab:tabstop=4 shiftwidth=4: diff --git a/Browser/GeoPositionPage.h b/Browser/GeoPositionPage.h index 37fa8ab4..cbb5013b 100644 --- a/Browser/GeoPositionPage.h +++ b/Browser/GeoPositionPage.h @@ -1,62 +1,62 @@ -/* Copyright (C) 2003-2018 Jesper K. Pedersen +/* Copyright (C) 2003-2019 The KPhotoAlbum Development Team This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; see the file COPYING. If not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #ifndef GEOPOSITIONPAGE_H #define GEOPOSITIONPAGE_H #include "BrowserPage.h" #include #include #include class QAbstractItemModel; class FlatCategoryModel; class BrowserWidget; namespace Browser { /** * \brief The Browser page for categories. * * See \ref Browser for a detailed description of how this fits in with the rest of the classes in this module * */ class GeoPositionPage : public BrowserPage { Q_OBJECT public: GeoPositionPage(const DB::ImageSearchInfo &info, BrowserWidget *browser); Viewer viewer() override; void activate() override; void deactivate() override; bool isSearchable() const override; bool showDuringMovement() const override; public slots: void slotNewRegionSelected(Map::GeoCoordinates::Pair coordinates); private: - bool active; + bool m_active; }; } #endif /* GEOPOSITIONPAGE_H */ // vi:expandtab:tabstop=4 shiftwidth=4: