From kdevelop-devel Sat Nov 20 17:00:04 2010 From: Milian Wolff Date: Sat, 20 Nov 2010 17:00:04 +0000 To: kdevelop-devel Subject: Re: Killability of ImportProjectJob Message-Id: <201011201800.04980.mail () milianw ! de> X-MARC-Message: https://marc.info/?l=kdevelop-devel&m=129027254932711 MIME-Version: 1 Content-Type: multipart/mixed; boundary="--===============1578035331==" --===============1578035331== Content-Type: multipart/signed; boundary="nextPart1972181.9t1Abg8D7H"; protocol="application/pgp-signature"; micalg=pgp-sha1 Content-Transfer-Encoding: 7bit --nextPart1972181.9t1Abg8D7H Content-Type: Text/Plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable On Saturday 20 November 2010 17:50:31 Milian Wolff wrote: > Hey all, >=20 > 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 =2D-- a/shell/project.cpp +++ b/shell/project.cpp @@ -237,9 +237,10 @@ public: =20 loading=3Dfalse; if(job->errorText().isEmpty()) { =2D 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 =3D iface->createImportJob(d->topItem ); + Core::self()->projectController()->projectModel()->appendRow(d->topIte= m); connect( importJob, SIGNAL( result( KJob* ) ), this, SLOT( importDone(= =20 KJob* ) ) ); Core::self()->runController()->registerJob( importJob ); return true; Which would be an (imo) awesome addition to KDevelop. It didn't used to wor= k=20 as items where added from random threads but now that they are always added= =20 from the UI it just works=E2=84=A2. =2D-=20 Milian Wolff mail@milianw.de http://milianw.de --nextPart1972181.9t1Abg8D7H Content-Type: application/pgp-signature; name=signature.asc Content-Description: This is a digitally signed message part. -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.11 (GNU/Linux) iEYEABECAAYFAkzn/pQACgkQDA6yEs0dE5PAeACguqs+CyTI4mA9r0hMZok4fUi8 xSUAnAwHITFHQa1D2WqayRTCNTzIZ5F4 =9BP7 -----END PGP SIGNATURE----- --nextPart1972181.9t1Abg8D7H-- --===============1578035331== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline -- KDevelop-devel mailing list KDevelop-devel@kdevelop.org https://barney.cs.uni-potsdam.de/mailman/listinfo/kdevelop-devel --===============1578035331==--