MCPcopy Create free account
hub / github.com/TheAssassin/AppImageLauncher / executeDeferredOperations

Method executeDeferredOperations

src/daemon/worker.cpp:119–149  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

117}
118
119void Worker::executeDeferredOperations() {
120 if (d->deferredOperations.empty()) {
121 qDebug() << "No deferred operations to execute";
122 return;
123 }
124
125 std::cout << "Executing deferred operations" << std::endl;
126
127 auto outputMutex = std::make_shared<QMutex>();
128
129 while (!d->deferredOperations.empty()) {
130 auto operation = d->deferredOperations.front();
131 d->deferredOperations.pop_front();
132 QThreadPool::globalInstance()->start(new PrivateData::OperationTask(operation, outputMutex));
133 }
134
135 // wait until all AppImages have been integrated
136 QThreadPool::globalInstance()->waitForDone();
137
138 std::cout << "Cleaning up old desktop integration files" << std::endl;
139 if (!cleanUpOldDesktopIntegrationResources(true)) {
140 std::cout << "Failed to clean up old desktop integration files" << std::endl;
141 }
142
143 // make sure the icons in the launcher are refreshed
144 std::cout << "Updating desktop database and icon caches" << std::endl;
145 if (!updateDesktopDatabaseAndIconCaches())
146 std::cout << "Failed to update desktop database and icon caches" << std::endl;
147
148 std::cout << "Done" << std::endl;
149}
150
151void Worker::scheduleForIntegration(const QString& path) {
152 auto operation = std::make_pair(path, INTEGRATE);

Callers 1

mainFunction · 0.80

Tested by

no test coverage detected