[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kdevelop-devel
Subject:    Re: Killability of ImportProjectJob
From:       Milian Wolff <mail () milianw ! de>
Date:       2010-11-20 17:00:04
Message-ID: 201011201800.04980.mail () milianw ! de
[Download RAW message or body]

[Attachment #2 (multipart/signed)]


On Saturday 20 November 2010 17:50:31 Milian Wolff wrote:
> Hey all,
> 
> currently the ImportProjectJob is not really interruptable. It has doKill
> that just waitForFinished which can easily lead to deadlocks nowadays,
> since we can import stuff from the background bug QMetaType::invokeMethod
> in the projectmodel then. E.g.:

btw, I just notice that this is probably only hit when I try this patch:

diff --git a/shell/project.cpp b/shell/project.cpp
index c8fbc53..877c4a9 100644
--- a/shell/project.cpp
+++ b/shell/project.cpp
@@ -237,9 +237,10 @@ public:
         
         loading=false;
         if(job->errorText().isEmpty()) {
-            projCtrl->projectModel()->appendRow(topItem);
             projCtrl->projectImportingFinished( project );
         } else {
+            Q_ASSERT(topItem->index().isValid());
+            projCtrl->projectModel()->removeRow(topItem->row());
             projCtrl->closeProject(project);
         }
     }
@@ -516,6 +517,7 @@ bool Project::open( const KUrl& projectFileUrl_ )
     d->loadVersionControlPlugin(projectGroup);
     d->progress->setBuzzy();
     KJob* importJob = iface->createImportJob(d->topItem );
+    Core::self()->projectController()->projectModel()->appendRow(d->topItem);
     connect( importJob, SIGNAL( result( KJob* ) ), this, SLOT( importDone( 
KJob* ) ) );
     Core::self()->runController()->registerJob( importJob );
     return true;

Which would be an (imo) awesome addition to KDevelop. It didn't used to work 
as items where added from random threads but now that they are always added 
from the UI it just works™.


-- 
Milian Wolff
mail@milianw.de
http://milianw.de

["signature.asc" (application/pgp-signature)]

-- 
KDevelop-devel mailing list
KDevelop-devel@kdevelop.org
https://barney.cs.uni-potsdam.de/mailman/listinfo/kdevelop-devel


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic