aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/plugins/CommandLineOptions/UninstallOption/uninstalloption.cpp1
-rw-r--r--src/qmmp/qmmp.pro2
-rw-r--r--src/qmmpui/winfileassoc.cpp19
-rw-r--r--src/qmmpui/winfileassoc.h3
4 files changed, 22 insertions, 3 deletions
diff --git a/src/plugins/CommandLineOptions/UninstallOption/uninstalloption.cpp b/src/plugins/CommandLineOptions/UninstallOption/uninstalloption.cpp
index bc6d4f885..7e19020b8 100644
--- a/src/plugins/CommandLineOptions/UninstallOption/uninstalloption.cpp
+++ b/src/plugins/CommandLineOptions/UninstallOption/uninstalloption.cpp
@@ -55,6 +55,7 @@ QString UninstallOption::executeCommand(const QString &opt_str, const QStringLis
}
assoc.GetRegisteredExtensions(extsToCheck, regExts);
assoc.RestoreFileAssociations(regExts);
+ assoc.RemoveClassId();
QMetaObject::invokeMethod(qApp, "quit", Qt::QueuedConnection);
}
return QString();
diff --git a/src/qmmp/qmmp.pro b/src/qmmp/qmmp.pro
index b19425c4d..a7a4e5513 100644
--- a/src/qmmp/qmmp.pro
+++ b/src/qmmp/qmmp.pro
@@ -87,7 +87,7 @@ unix {
}
win32 {
- SVN_REVISION = $$system(svn_revision.cmd)
+ SVN_REVISION = $$system(./svn_revision.sh)
isEmpty(SVN_REVISION) {
SVN_REVISION = $$system(sh svn_revision.sh)
}
diff --git a/src/qmmpui/winfileassoc.cpp b/src/qmmpui/winfileassoc.cpp
index 7eb0e6c6f..10a7e48e5 100644
--- a/src/qmmpui/winfileassoc.cpp
+++ b/src/qmmpui/winfileassoc.cpp
@@ -235,6 +235,17 @@ int WinFileAssoc::RestoreFileAssociations(const QStringList &fileExtensions)
RegCU.remove("Software/Classes/." + fileExtension + "/Qmmp_Backup");
RegCU.remove(ExtKeyName + "/Qmmp_Backup_Application");
RegCU.remove(ExtKeyName + "/Qmmp_Backup_ProgId");
+
+ //remove empty groups
+ RegCU.beginGroup(ExtKeyName);
+ if(RegCU.childGroups().isEmpty() && RegCU.childKeys().isEmpty())
+ {
+ RegCU.endGroup();
+ RegCU.remove(ExtKeyName);
+ }
+ else
+ RegCU.endGroup();
+
}
SHChangeNotify(SHCNE_ASSOCHANGED, SHCNF_IDLIST, NULL, NULL);
return count;
@@ -285,6 +296,14 @@ bool WinFileAssoc::RemoveClassId()
return false;
RegCU.remove(classId);
+
+ QSettings RegCR("HKEY_CLASSES_ROOT", QSettings::NativeFormat);
+
+ if(!RegCR.isWritable() || RegCU.status() != QSettings::NoError)
+ return false;
+
+ RegCR.remove("Applications/qmmp.exe");
+
return true;
}
diff --git a/src/qmmpui/winfileassoc.h b/src/qmmpui/winfileassoc.h
index 7c5a5b351..9b7af9f2c 100644
--- a/src/qmmpui/winfileassoc.h
+++ b/src/qmmpui/winfileassoc.h
@@ -40,14 +40,13 @@ protected:
protected:
bool CreateClassId(const QString& executablePath, const QString& friendlyName);
- bool RemoveClassId();
bool VistaGetDefaultApps(const QStringList &extensions, QStringList& registeredExt);
int VistaSetAppsAsDefault(const QStringList& extensions);
public:
WinFileAssoc(const QString ClassId = "QmmpFileAudio", const QString AppName="Qmmp");
//Checks the registry to see which extensions are registered with SMPlayer
bool GetRegisteredExtensions(const QStringList& extensionsToCheck, QStringList& registeredExtensions);
-
+ bool RemoveClassId();
int CreateFileAssociations(const QStringList& fileExtensions);
int RestoreFileAssociations(const QStringList& fileExtensions);
};