Commit b2d335e7 authored by Laurent Montel's avatar Laurent Montel 😁

Remove syncaction as it's not implemented

parent c500ff7a
configure_file(config-enterprise.h.cmake ${CMAKE_CURRENT_BINARY_DIR}/config-enterprise.h )
configure_file(kontact-version.h.cmake ${CMAKE_CURRENT_BINARY_DIR}/kontact-version.h @ONLY)
add_subdirectory(about)
......
#cmakedefine KDEPIM_ENTERPRISE_BUILD 1
......@@ -20,8 +20,6 @@
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
#include <config-enterprise.h>
#include "mainwindow.h"
#include "aboutdialog.h"
#include "prefs.h"
......@@ -418,29 +416,6 @@ void MainWindow::setupActions()
actionCollection()->setDefaultShortcuts(mNewActions, KStandardShortcut::openNew());
connect(mNewActions, &KActionMenu::triggered, this, &MainWindow::slotNewClicked);
// If the user is using disconnected imap mail folders as groupware, we add
// plugins' Synchronize actions to the toolbar which trigger an imap sync.
// Otherwise it's redundant and misleading.
KConfig _config(QStringLiteral("kmail2rc"));
KConfigGroup config(&_config, "Groupware");
#if defined(KDEPIM_ENTERPRISE_BUILD)
bool defGW = config.readEntry("Enabled", true);
#else
bool defGW = config.readEntry("Enabled", false);
#endif
KConfig *_cfg = Prefs::self()->config();
KConfigGroup cfg(_cfg, "Kontact Groupware Settings");
mSyncActionsEnabled = cfg.readEntry("GroupwareMailFoldersEnabled", defGW);
if (mSyncActionsEnabled) {
mSyncActions = new KActionMenu(
QIcon::fromTheme(QStringLiteral("view-refresh")),
i18nc("@title:menu synchronize pim items (message,calendar,to-do,etc.)", "Sync"), this);
actionCollection()->addAction(QStringLiteral("action_sync"), mSyncActions);
actionCollection()->setDefaultShortcuts(mSyncActions, KStandardShortcut::reload());
connect(mSyncActions, &KActionMenu::triggered, this, &MainWindow::slotSyncClicked);
}
QAction *action =
new QAction(QIcon::fromTheme(QStringLiteral("configure")),
i18nc("@action:inmenu", "Configure Kontact..."), this);
......@@ -736,22 +711,6 @@ void MainWindow::slotNewClicked()
}
}
void MainWindow::slotSyncClicked()
{
if (!mCurrentPlugin->syncActions().isEmpty()) {
mCurrentPlugin->syncActions().at(0)->trigger();
} else {
PluginList::Iterator it;
PluginList::Iterator end(mPlugins.end());
for (it = mPlugins.begin(); it != end; ++it) {
if (!(*it)->syncActions().isEmpty()) {
(*it)->syncActions().first()->trigger();
return;
}
}
}
}
KToolBar *MainWindow::findToolBar(const char *name)
{
// like KMainWindow::toolBar, but which doesn't create the toolbar if not found
......
......@@ -78,7 +78,6 @@ protected Q_SLOTS:
void slotActivePartChanged(KParts::Part *part);
void slotPreferences();
void slotNewClicked();
void slotSyncClicked();
void slotQuit();
void slotNewToolbarConfig();
void slotShowIntroduction();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment