diff --git a/src/AbstractTimeServiceManager.cpp b/src/AbstractTimeServiceManager.cpp index 872ce62..009c649 100644 --- a/src/AbstractTimeServiceManager.cpp +++ b/src/AbstractTimeServiceManager.cpp @@ -71,7 +71,7 @@ QVector> &AbstractTimeServiceManager::users() QString AbstractTimeServiceManager::projectName(const QString &projectId) { - for (auto &item : projects()) + for (const auto &item : projects()) if (item.id() == projectId) return item.name(); diff --git a/src/ModifyJobDialog.cpp b/src/ModifyJobDialog.cpp index d1a7de2..d8870f3 100644 --- a/src/ModifyJobDialog.cpp +++ b/src/ModifyJobDialog.cpp @@ -14,7 +14,7 @@ ModifyJobDialog::ModifyJobDialog(AbstractTimeServiceManager *manager, const Time auto layout = new QGridLayout{this}; QComboBox *project{new QComboBox{this}}; - for (auto &p : m_availableProjects) + for (const auto &p : m_availableProjects) project->addItem(p.name(), p.id()); project->setCurrentIndex( m_availableProjects.indexOf(entry.project().id().isEmpty() ? m_availableProjects.first() : entry.project())); diff --git a/src/SettingsDialog.cpp b/src/SettingsDialog.cpp index 97c06b6..2d62c68 100644 --- a/src/SettingsDialog.cpp +++ b/src/SettingsDialog.cpp @@ -32,7 +32,7 @@ SettingsDialog::SettingsDialog(AbstractTimeServiceManager *manager, m_availableManagers{availableManagers}, m_tabWidget{new QTabWidget} { - for (auto &project : m_manager->projects()) + for (const auto &project : m_manager->projects()) { m_availableProjects.first.push_back(project.id()); m_availableProjects.second.push_back(project.name()); diff --git a/src/TrayIcons.cpp b/src/TrayIcons.cpp index 9d6008a..06100c2 100644 --- a/src/TrayIcons.cpp +++ b/src/TrayIcons.cpp @@ -323,15 +323,6 @@ void TrayIcons::updateRunningEntryTooltip() (m_breakIcon ? m_breakIcon : m_trayIcon)->setToolTip(tooltip); } -void TrayIcons::getNewProjectId() -{ - SettingsDialog d{m_manager, - {{QStringLiteral("Clockify"), QStringLiteral("com.clockify")}, - {QStringLiteral("TimeCamp"), QStringLiteral("com.timecamp")}}}; - d.switchToPage(SettingsDialog::Pages::ProjectPage); - d.exec(); -} - void TrayIcons::showAboutDialog() { // put this into a variable to handle this gonzo string more nicely diff --git a/src/TrayIcons.h b/src/TrayIcons.h index b3e183e..50f8990 100644 --- a/src/TrayIcons.h +++ b/src/TrayIcons.h @@ -35,7 +35,6 @@ class TrayIcons : public QObject private slots: void updateTrayIcons(); void updateRunningEntryTooltip(); - void getNewProjectId(); void showAboutDialog(); void showLicenseDialog(QWidget *parent = nullptr);