[SCM] Kaboom - Debian KDE 3->4 migration tool branch, master, updated. 542676d733ded7733678caa360aada6729e76c4a

Sune Vuorela pusling-guest at alioth.debian.org
Mon Feb 23 23:00:35 UTC 2009


The following commit has been merged in the master branch:
commit 542676d733ded7733678caa360aada6729e76c4a
Author: Sune Vuorela <sune at vuorela.dk>
Date:   Tue Feb 24 00:00:28 2009 +0100

    increase error handling

diff --git a/migrationpage.cpp b/migrationpage.cpp
index ac41291..64f1f91 100644
--- a/migrationpage.cpp
+++ b/migrationpage.cpp
@@ -27,7 +27,12 @@ MigrationPagePrivate::MigrationPagePrivate(MigrationPage* parent)
   backup=true;
   selection=MigrationTool::Migrate;
   progress=new ProgressWidget(q);
-  start = new QPushButton("Start",q);
+  start = new QPushButton(tr("Start"),q);
+  error = new QLabel(q);
+  errorbox = new QGroupBox(tr("Errors occured"),q);
+  QBoxLayout *errorboxlayout = new QHBoxLayout(errorbox);
+  errorboxlayout->addWidget(error);
+  errorbox->hide();
 }
 
 void MigrationPagePrivate::doMagic()
@@ -47,43 +52,57 @@ void MigrationPagePrivate::doMagic()
       catch (DirOperations::Exception &e)
       {
         qDebug() << e.what();
+        errorhandling(e.what());
         // emit q->error(e) or something
       }
       qDebug() << "doing recursive copy of .kde to .kde3-backup";
     }
   }
-  switch(selection)
+  try
   {
-    case MigrationTool::Migrate:
-      progress->setMaximum(1); //fake the progress bar progress.
-      progress->setValue(1);
-      qDebug() << "do nothing, let kconf_update do magic";
-      break;
-    case MigrationTool::Merge:
-      DirOperations::recursiveCpDir(QDir::homePath()+KDE4DIR,QDir::homePath()+KDEDIR,
-                                     DirOperations::OverWrite,progress);
-      qDebug() << "do magic experimental merge";
-      break;
-    case MigrationTool::Clean:
-      qDebug() << "do recursive rm of .kde dir";
-      DirOperations::recursiveRmDir(QDir::homePath()+KDEDIR,progress);
-      break;
-    case MigrationTool::Move:
-      DirOperations::recursiveCpDir(QDir::homePath()+KDE4DIR,QDir::homePath()+KDEDIR,
-                                     DirOperations::RemoveDestination, progress);
-      qDebug() << "move .kde4 over .kde";
-      break;
+    switch(selection)
+    {
+      case MigrationTool::Migrate:
+        progress->setMaximum(1); //fake the progress bar progress.
+        progress->setValue(1);
+        qDebug() << "do nothing, let kconf_update do magic";
+        break;
+      case MigrationTool::Merge:
+        DirOperations::recursiveCpDir(QDir::homePath()+KDE4DIR,QDir::homePath()+KDEDIR,
+                                      DirOperations::OverWrite,progress);
+        qDebug() << "do magic experimental merge";
+        break;
+      case MigrationTool::Clean:
+        qDebug() << "do recursive rm of .kde dir";
+        DirOperations::recursiveRmDir(QDir::homePath()+KDEDIR,progress);
+        break;
+      case MigrationTool::Move:
+        DirOperations::recursiveCpDir(QDir::homePath()+KDE4DIR,QDir::homePath()+KDEDIR,
+                                      DirOperations::RemoveDestination, progress);
+        qDebug() << "move .kde4 over .kde";
+        break;
+    }
+  }
+  catch(DirOperations::Exception & e)
+  {
+    errorhandling(e.what());
   }
-  complete=true;
   
+  complete=true;
   emit q->completeChanged();
 }
+void MigrationPagePrivate::errorhandling(const QString& err)
+{
+  error->setText(err);
+  errorbox->show();
+}
 
 MigrationPage::MigrationPage(QWidget *parent) : QWizardPage(parent)
 {
   d=new MigrationPagePrivate(this);
   QLabel *text = new QLabel(tr("When you click \"start\", migration will start"),this);
   
+  
   setTitle(tr("Start Migration"));
 
   connect(d->start,SIGNAL(clicked()),d,SLOT(doMagic()));
@@ -92,6 +111,7 @@ MigrationPage::MigrationPage(QWidget *parent) : QWizardPage(parent)
   lay->addWidget(text);
   lay->addWidget(d->progress);
   lay->addWidget(d->start);
+  lay->addWidget(d->errorbox);
   setLayout(lay);
   
 }
diff --git a/migrationpage_p.h b/migrationpage_p.h
index ff1cd82..660184e 100644
--- a/migrationpage_p.h
+++ b/migrationpage_p.h
@@ -31,8 +31,11 @@ class MigrationPagePrivate : public QObject
     ProgressWidget *progress;
     QPushButton *start;
     MigrationPage *q;
+    QLabel *error;
+    QGroupBox *errorbox;
     bool backup;
     bool complete;
+    void errorhandling(const QString &s);
   public slots:
     void doMagic();
 };

-- 
Kaboom - Debian KDE 3->4 migration tool



More information about the pkg-kde-commits mailing list