@@ -177,7 +177,7 @@ private Q_SLOTS:
177177 appManager->addApplication(new MockApp("abs-icon"));
178178 QCOMPARE(launcherModel->rowCount(QModelIndex()), 1);
179179
180− appManager->addApplication(new MockApp("no-icon"));
180+ appManager->addApplication(new MockApp("rel-icon"));
181181 QCOMPARE(launcherModel->rowCount(QModelIndex()), 2);
182182
183183 launcherModel->m_settings->setStoredApplications(QStringList());
@@ -199,6 +199,10 @@ private Q_SLOTS:
199199 QString::fromUtf8(g_get_user_name()));
200200 QVERIFY(removeReply.isValid());
201201 QCOMPARE(removeReply.value(), true);
202+
203+ // Some tests move the directory, so lets move it back if so.
204+ // But this will usually fail.
205+ QFile::rename("applications.old", "applications");
202206 }
203207
204208 void testMove() {
@@ -331,7 +335,7 @@ private Q_SLOTS:
331335
332336 void testApplicationRunning() {
333337 launcherModel->pin("abs-icon");
334− launcherModel->pin("no-icon");
338+ launcherModel->pin("rel-icon");
335339
336340 QCOMPARE(launcherModel->get(0)->running(), true);
337341 QCOMPARE(launcherModel->get(1)->running(), true);
@@ -340,7 +344,7 @@ private Q_SLOTS:
340344 QCOMPARE(launcherModel->get(0)->running(), false);
341345 QCOMPARE(launcherModel->get(1)->running(), true);
342346
343− appManager->stopApplication("no-icon");
347+ appManager->stopApplication("rel-icon");
344348 QCOMPARE(launcherModel->get(0)->running(), false);
345349 QCOMPARE(launcherModel->get(1)->running(), false);
346350 }
@@ -355,7 +359,7 @@ private Q_SLOTS:
355359 QCOMPARE(launcherModel->get(0)->focused(), true);
356360 QCOMPARE(launcherModel->get(1)->focused(), false);
357361
358− appManager->focusApplication("no-icon");
362+ appManager->focusApplication("rel-icon");
359363 QCOMPARE(launcherModel->rowCount(QModelIndex()), 2);
360364 QCOMPARE(launcherModel->get(0)->focused(), false);
361365 QCOMPARE(launcherModel->get(1)->focused(), true);
@@ -377,8 +381,8 @@ private Q_SLOTS:
377381 QCOMPARE(launcherModel->rowCount(), 2);
378382
379383 // stop the second one keeping it pinned so that it doesn't go away
380− launcherModel->pin("no-icon");
381− appManager->stopApplication("no-icon");
384+ launcherModel->pin("rel-icon");
385+ appManager->stopApplication("rel-icon");
382386
383387 // find the first Quit item, should be there
384388 QuickListModel *model = qobject_cast<QuickListModel*>(launcherModel->get(0)->quickList());
@@ -407,7 +411,7 @@ private Q_SLOTS:
407411 // first app should be gone...
408412 QCOMPARE(launcherModel->rowCount(QModelIndex()), 1);
409413 // ... the second app (now at index 0) should still be there, pinned and stopped
410− QCOMPARE(launcherModel->get(0)->appId(), QStringLiteral("no-icon"));
414+ QCOMPARE(launcherModel->get(0)->appId(), QStringLiteral("rel-icon"));
411415 QCOMPARE(launcherModel->get(0)->pinned(), true);
412416 QCOMPARE(launcherModel->get(0)->running(), false);
413417 }
@@ -602,17 +606,16 @@ private Q_SLOTS:
602606
603607 // pin both apps
604608 launcherModel->pin("abs-icon");
605− launcherModel->pin("no-icon");
609+ launcherModel->pin("rel-icon");
606610 // close both apps
607611 appManager->removeApplication(0);
608612 appManager->removeApplication(0);
609613
610614 // "delete" the .desktop files
611− QString oldCurrent = QDir::currentPath();
612615 if (deleted) {
613616 // In testing mode, the launcher searches the current dir for the sample .desktop file
614− // We can make that fail by changing the current dir
615− QDir::setCurrent("..");
617+ // We can make that fail by moving the applications dir
618+ QFile::rename("applications", "applications.old");
616619 }
617620
618621 // Call refresh
@@ -623,9 +626,6 @@ private Q_SLOTS:
623626 QCOMPARE(reply.isValid(), true);
624627
625628 QCOMPARE(launcherModel->rowCount(), deleted ? 0 : 2);
626−
627− // Restoring current dir
628− QDir::setCurrent(oldCurrent);
629629 }
630630
631631 void testSettings() {
@@ -637,7 +637,7 @@ private Q_SLOTS:
637637
638638 // pin both apps
639639 launcherModel->pin("abs-icon");
640− launcherModel->pin("no-icon");
640+ launcherModel->pin("rel-icon");
641641 QCOMPARE(spy.count(), 0);
642642
643643 // Now settings should have 2 apps
@@ -659,9 +659,9 @@ private Q_SLOTS:
659659 QCOMPARE(launcherModel->rowCount(), 1);
660660
661661 // Add them back but in reverse order
662− settings->simulateDConfChanged(QStringList() << "no-icon" << "abs-icon");
662+ settings->simulateDConfChanged(QStringList() << "rel-icon" << "abs-icon");
663663 QCOMPARE(launcherModel->rowCount(), 2);
664− QCOMPARE(launcherModel->get(0)->appId(), QString("no-icon"));
664+ QCOMPARE(launcherModel->get(0)->appId(), QString("rel-icon"));
665665 QCOMPARE(launcherModel->get(1)->appId(), QString("abs-icon"));
666666 QCOMPARE(spy.count(), 2);
667667 }
@@ -671,7 +671,7 @@ private Q_SLOTS:
671671 QCOMPARE(launcherModel->rowCount(), getASConfig().count());
672672
673673 int oldCount = launcherModel->rowCount();
674− appManager->addApplication(new MockApp("rel-icon"));
674+ appManager->addApplication(new MockApp("click-icon"));
675675 QCOMPARE(launcherModel->rowCount(), oldCount + 1);
676676 QCOMPARE(launcherModel->rowCount(), getASConfig().count());
677677 }