Ticket #9648: 26-win32-path

File 26-win32-path, 2.7 KB (added by Mark Spieth, 13 years ago)
Line 
1absolute path testing fixups for win32 support
2
3From: Mark Spieth <mspieth@digivation.com.au>
4
5
6---
7 mythtv/libs/libmyth/programinfo.h          |    6 +++++-
8 mythtv/libs/libmythbase/system-windows.cpp |    2 +-
9 mythtv/libs/libmythmetadata/dirscan.cpp    |    9 ++++++---
10 3 files changed, 12 insertions(+), 5 deletions(-)
11
12diff --git a/mythtv/libs/libmyth/programinfo.h b/mythtv/libs/libmyth/programinfo.h
13index 47d5672..7509100 100644
14--- a/mythtv/libs/libmyth/programinfo.h
15+++ b/mythtv/libs/libmyth/programinfo.h
16@@ -287,7 +287,11 @@ class MPUBLIC ProgramInfo
17         { return GetProgramInfoType() == kProgramInfoTypeVideoDVD; }
18     bool IsVideoBD(void) const
19         { return GetProgramInfoType() == kProgramInfoTypeVideoBD; }
20-    bool IsLocal(void) const { return pathname.left(1) == "/"; }
21+    bool IsLocal(void) const { return pathname.left(1) == "/"
22+#ifdef _WIN32
23+        || pathname.at(1) == ':'
24+#endif
25+            ; }
26     bool IsMythStream(void) const { return pathname.left(7) == "myth://"; }
27     bool IsPathSet(void) const { return GetBasename() != pathname; }
28     bool HasPathname(void) const { return !GetPathname().isEmpty(); }
29diff --git a/mythtv/libs/libmythbase/system-windows.cpp b/mythtv/libs/libmythbase/system-windows.cpp
30index a6fbc35..fb10e22 100644
31--- a/mythtv/libs/libmythbase/system-windows.cpp
32+++ b/mythtv/libs/libmythbase/system-windows.cpp
33@@ -616,7 +616,7 @@ void MythSystemWindows::Fork(time_t timeout)
34     }
35 
36     // set up command args
37-    QString cmd = GetCommand() + " " + GetArgs().join(" ");
38+    QString cmd = GetCommand().replace('/','\\') + " " + GetArgs().join(" ");
39     if (GetSetting("UseShell"))
40         cmd.prepend("cmd.exe /c ");
41 
42diff --git a/mythtv/libs/libmythmetadata/dirscan.cpp b/mythtv/libs/libmythmetadata/dirscan.cpp
43index e47b893..37902f6 100644
44--- a/mythtv/libs/libmythmetadata/dirscan.cpp
45+++ b/mythtv/libs/libmythmetadata/dirscan.cpp
46@@ -226,11 +226,14 @@ bool ScanVideoDirectory(const QString &start_path, DirectoryHandler *handler,
47 
48     if (!start_path.startsWith("myth://"))
49     {
50-        VERBOSE(VB_GENERAL, QString("MythVideo::ScanVideoDirectory Scanning (%1)").arg(start_path));
51+        QString path = start_path;
52+        if (path.startsWith("/") && (path.indexOf(':') == 2))
53+            path.remove(0,1);
54+        VERBOSE(VB_GENERAL, QString("MythVideo::ScanVideoDirectory Scanning (%1)").arg(path));
55 
56-        if (!scan_dir(start_path, handler, extlookup))
57+        if (!scan_dir(path, handler, extlookup))
58         {
59-            VERBOSE(VB_GENERAL, QString("MythVideo::ScanVideoDirectory failed to scan %1").arg(start_path));
60+            VERBOSE(VB_GENERAL, QString("MythVideo::ScanVideoDirectory failed to scan %1").arg(path));
61             pathScanned = false;
62         }
63     }