qtd3dservice: Remove control file handling
authorAndrew Knight <andrew.knight@digia.com>
Thu, 13 Mar 2014 10:32:23 +0000 (12:32 +0200)
committerThe Qt Project <gerrit-noreply@qt-project.org>
Tue, 18 Mar 2014 07:21:49 +0000 (08:21 +0100)
This is no longer necessary, as d3dcompiler_qt no longer relies
on a control file.

Change-Id: I689afaf02f30adc3d733aa6fa47bd96c85f8459b
Reviewed-by: Oliver Wolff <oliver.wolff@digia.com>
src/qtd3dservice/appxhandler.cpp
src/qtd3dservice/d3dservice.cpp
src/qtd3dservice/xaphandler.cpp

index 5e956a7..f6623ea 100644 (file)
@@ -215,7 +215,6 @@ extern int handleAppxDevice(int deviceIndex, const QString &app, const QString &
             + QStringLiteral("\\Packages\\")
             + QString::fromWCharArray(WindowsGetStringRawBuffer(packageFamilyName, Q_NULLPTR))
             + QStringLiteral("\\LocalState\\d3dcompiler");
-    const QString remoteControlFile = remoteBase + QStringLiteral("\\control");
     const QString remoteSourcePath = remoteBase + QStringLiteral("\\source\\");
     const QString remoteBinaryPath = remoteBase + QStringLiteral("\\binary\\");
 
@@ -239,17 +238,6 @@ extern int handleAppxDevice(int deviceIndex, const QString &app, const QString &
                 dir.cd(QStringLiteral("d3dcompiler"));
             }
 
-            // Check if control file exists
-            if (!QFile::exists(remoteControlFile)) {
-                QFile file(remoteControlFile);
-                if (!file.open(QFile::WriteOnly)) {
-                    qCWarning(lcD3DService) << "Could not create control file:" << file.errorString();
-                    Sleep(1000);
-                    continue;
-                }
-                file.write("Qt D3D compilation service");
-            }
-
             if (!QFile::exists(remoteSourcePath)) {
                 if (!dir.mkpath(QStringLiteral("source"))) {
                     qCWarning(lcD3DService) << "Could not create source directory.";
@@ -269,16 +257,6 @@ extern int handleAppxDevice(int deviceIndex, const QString &app, const QString &
             checkDirectories = false;
         }
 
-        QFile file(remoteControlFile);
-        if (!file.open(QFile::WriteOnly)) {
-            qCWarning(lcD3DService) << "Could not create control file:"
-                                    << file.errorString();
-            checkDirectories = true;
-            Sleep(1000);
-            continue;
-        }
-        file.write("Qt D3D compilation service");
-
         // Ok, ready to check for shaders
         QDirIterator it(remoteSourcePath);
         while (it.hasNext()) {
index f8843c1..1594cb0 100644 (file)
@@ -180,10 +180,6 @@ static QString prepareCache(const QString &device, const QString &app)
         return QString();
     if (!baseDir.mkpath(QStringLiteral("binary")))
         return QString();
-    QFile controlFile(baseDir.absoluteFilePath(QStringLiteral("control")));
-    if (!controlFile.open(QFile::WriteOnly))
-        return QString();
-    controlFile.write(QByteArrayLiteral("Qt D3D shader compilation service"));
     return QDir::toNativeSeparators(baseDir.absolutePath());
 }
 
index a8006ef..3c306e4 100644 (file)
@@ -216,13 +216,11 @@ extern int handleXapDevice(int deviceIndex, const QString &app, const QString &l
         return 1;
     }
 
-    const QString localControlFile = localBase + QStringLiteral("\\control");
     const QString localSourcePath = localBase + QStringLiteral("\\source\\");
     const QString localBinaryPath = localBase + QStringLiteral("\\binary\\");
 
     const QString remoteBase = QStringLiteral("%FOLDERID_APPID_ISOROOT%\\")
                     + app + QStringLiteral("\\d3dcompiler");
-    const QString remoteControlFile = remoteBase + QStringLiteral("\\control");
     const QString remoteSourcePath = remoteBase + QStringLiteral("\\source\\");
     const QString remoteBinaryPath = remoteBase + QStringLiteral("\\binary\\");
 
@@ -253,9 +251,7 @@ extern int handleXapDevice(int deviceIndex, const QString &app, const QString &l
         return 1;
     }
 
-    int round = 0;
     bool wasDisconnected = true;
-    FileInfo controlFileInfo;
     forever {
         // If the run lock is signaled, it's time to quit
         if (WaitForSingleObject(runLock, 0) == WAIT_OBJECT_0)
@@ -297,32 +293,6 @@ extern int handleXapDevice(int deviceIndex, const QString &app, const QString &l
 
         // Run certain setup steps once per connection
         if (wasDisconnected) {
-            // Check if control file exists
-            hr = connection->GetFileInfo(bstr(remoteControlFile), &controlFileInfo);
-            if (FAILED(hr)) {
-                if (hr != 0x80070003 /* Not found */) {
-                    qCWarning(lcD3DService) << "Unable to obtain file info:"
-                                            << coreConServer->formatError(hr);
-                    Sleep(1000);
-                    continue;
-                }
-                // Not found, so let's upload it
-                hr = connection->SendFile(bstr(localControlFile), bstr(remoteControlFile), CREATE_ALWAYS, NULL);
-                if (FAILED(hr)) {
-                    if (hr == 0x8973190e) {
-                        // This can happen during normal reinstallation, so continue
-                        qCDebug(lcD3DService) << "Unable to send control file, retrying...";
-                        wasDisconnected = true;
-                        Sleep(1000);
-                    } else {
-                        qCWarning(lcD3DService) << "Unable to send control file:"
-                                                << coreConServer->formatError(hr);
-                        return 1;
-                    }
-                    continue;
-                }
-            }
-
             FileInfo remoteDirectoryInfo;
             hr = connection->GetFileInfo(bstr(remoteSourcePath), &remoteDirectoryInfo);
             if (FAILED(hr)) {
@@ -363,19 +333,6 @@ extern int handleXapDevice(int deviceIndex, const QString &app, const QString &l
             wasDisconnected = false;
         }
 
-        // Update roughly every 30 seconds
-        if (round++ % 30 == 0) {
-            GetSystemTimeAsFileTime(&controlFileInfo.m_LastWriteTime);
-            hr = connection->SetFileInfo(bstr(remoteControlFile), &controlFileInfo);
-            round = 1;
-            if (FAILED(hr)) {
-                qCWarning(lcD3DService) << "Unable to update control file:"
-                                        << coreConServer->formatError(hr);
-                Sleep(1000);
-                continue;
-            }
-        }
-
         // Ok, ready to check for shaders
         SAFEARRAY *listing;
         hr = connection4->GetDirectoryListing(bstr(remoteSourcePath), &listing);