Commit 8aec312f authored by David Jarvie's avatar David Jarvie
Browse files

Fix calendar format conversion prompt modality

parent c015c156
...@@ -31,6 +31,7 @@ ...@@ -31,6 +31,7 @@
#include "collectionattribute.h" #include "collectionattribute.h"
#include "compatibilityattribute.h" #include "compatibilityattribute.h"
#include "eventattribute.h" #include "eventattribute.h"
#include "mainwindow.h"
#include "preferences.h" #include "preferences.h"
#include "synchtimer.h" #include "synchtimer.h"
#include "kalarmsettings.h" #include "kalarmsettings.h"
...@@ -1566,7 +1567,7 @@ void AkonadiModel::slotRowsInserted(const QModelIndex& parent, int start, int en ...@@ -1566,7 +1567,7 @@ void AkonadiModel::slotRowsInserted(const QModelIndex& parent, int start, int en
if (!mCollectionsBeingCreated.contains(collection.remoteId())) if (!mCollectionsBeingCreated.contains(collection.remoteId()))
{ {
// Update to current KAlarm format if necessary, and if the user agrees // Update to current KAlarm format if necessary, and if the user agrees
CalendarMigrator::updateToCurrentFormat(collection, false, this); CalendarMigrator::updateToCurrentFormat(collection, false, MainWindow::mainMainWindow());
} }
} }
else else
......
...@@ -275,7 +275,7 @@ void CalendarMigrator::calendarCreated(CalendarCreator* creator) ...@@ -275,7 +275,7 @@ void CalendarMigrator::calendarCreated(CalendarCreator* creator)
* Note: the collection should be up to date: use AkonadiModel::refresh() before * Note: the collection should be up to date: use AkonadiModel::refresh() before
* calling this function. * calling this function.
*/ */
void CalendarMigrator::updateToCurrentFormat(const Collection& collection, bool ignoreKeepFormat, QObject* parent) void CalendarMigrator::updateToCurrentFormat(const Collection& collection, bool ignoreKeepFormat, QWidget* parent)
{ {
kDebug() << collection.id(); kDebug() << collection.id();
AgentInstance agent = AgentManager::self()->instance(collection.resource()); AgentInstance agent = AgentManager::self()->instance(collection.resource());
...@@ -325,7 +325,7 @@ bool CalendarUpdater::update() ...@@ -325,7 +325,7 @@ bool CalendarUpdater::update()
QString versionString = KAlarm::getVersionString(compatAttr->version()); QString versionString = KAlarm::getVersionString(compatAttr->version());
QString msg = KAlarm::Calendar::conversionPrompt(mCollection.name(), versionString, false); QString msg = KAlarm::Calendar::conversionPrompt(mCollection.name(), versionString, false);
kDebug() << "Version" << versionString; kDebug() << "Version" << versionString;
if (KMessageBox::warningYesNo(0, msg) == KMessageBox::Yes) if (KMessageBox::warningYesNo(qobject_cast<QWidget*>(mParent), msg) == KMessageBox::Yes)
{ {
// Tell the resource to update the backend storage format // Tell the resource to update the backend storage format
QString errmsg; QString errmsg;
......
...@@ -42,7 +42,7 @@ class CalendarMigrator : public QObject ...@@ -42,7 +42,7 @@ class CalendarMigrator : public QObject
~CalendarMigrator(); ~CalendarMigrator();
static CalendarMigrator* instance(); static CalendarMigrator* instance();
static void execute(); static void execute();
static void updateToCurrentFormat(const Akonadi::Collection&, bool ignoreKeepFormat, QObject* parent); static void updateToCurrentFormat(const Akonadi::Collection&, bool ignoreKeepFormat, QWidget* parent);
template <class Interface> static Interface* getAgentInterface(const Akonadi::AgentInstance&, QString& errorMessage, QObject* parent); template <class Interface> static Interface* getAgentInterface(const Akonadi::AgentInstance&, QString& errorMessage, QObject* parent);
signals: signals:
......
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