summaryrefslogtreecommitdiffstats
path: root/noatun/noatun20update.cpp
diff options
context:
space:
mode:
authortoma <toma@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2009-11-25 17:56:58 +0000
committertoma <toma@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2009-11-25 17:56:58 +0000
commite2de64d6f1beb9e492daf5b886e19933c1fa41dd (patch)
tree9047cf9e6b5c43878d5bf82660adae77ceee097a /noatun/noatun20update.cpp
downloadtdemultimedia-e2de64d6f1beb9e492daf5b886e19933c1fa41dd.tar.gz
tdemultimedia-e2de64d6f1beb9e492daf5b886e19933c1fa41dd.zip
Copy the KDE 3.5 branch to branches/trinity for new KDE 3.5 features.
BUG:215923 git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/kdemultimedia@1054174 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'noatun/noatun20update.cpp')
-rw-r--r--noatun/noatun20update.cpp41
1 files changed, 41 insertions, 0 deletions
diff --git a/noatun/noatun20update.cpp b/noatun/noatun20update.cpp
new file mode 100644
index 00000000..e6a611f0
--- /dev/null
+++ b/noatun/noatun20update.cpp
@@ -0,0 +1,41 @@
+// Convert Noatun 1.2 plugins that no longer exist to their closest 2.0
+// counterparts.
+
+#include <qfile.h>
+#include <qregexp.h>
+
+#ifndef stdin
+extern "C" FILE *stdin;
+#endif
+
+#ifndef stdout
+extern "C" FILE *stdout;
+#endif
+
+int main(int, char **)
+{
+ QFile qin, qout;
+ qin.open(IO_ReadOnly, stdin);
+ qout.open(IO_WriteOnly, stdout);
+
+ QString text = qin.readAll();
+
+ // tag loaders
+ bool tagloaders = text.contains("id3tag.plugin") ||
+ text.contains("oggtag.plugin") ||
+ text.contains("luckytag.plugin");
+
+ text.replace(QRegExp("id3tag\\.plugin"), "");
+ text.replace(QRegExp("oggtag\\.plugin"), "");
+ text.replace(QRegExp("luckytag\\.plugin"), "");
+
+ if(tagloaders) text.replace(QRegExp("Modules="), "Modules=metatag.plugin,");
+
+ // playlists
+ text.replace(QRegExp("tron\\.plugin"), "splitplaylist.plugin");
+ text.replace(QRegExp("liszt\\.plugin"), "splitplaylist.plugin");
+
+ qout.writeBlock(text.local8Bit());
+
+ return 0;
+}