[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[GNUnet-SVN] r9910 - in gnunet-qt/src: common plugins/fs
From: |
gnunet |
Subject: |
[GNUnet-SVN] r9910 - in gnunet-qt/src: common plugins/fs |
Date: |
Sun, 27 Dec 2009 13:11:08 +0100 |
Author: durner
Date: 2009-12-27 13:11:08 +0100 (Sun, 27 Dec 2009)
New Revision: 9910
Modified:
gnunet-qt/src/common/desktopServices.cc
gnunet-qt/src/common/desktopServices.h
gnunet-qt/src/plugins/fs/fs.cc
Log:
cond inclusion
Modified: gnunet-qt/src/common/desktopServices.cc
===================================================================
--- gnunet-qt/src/common/desktopServices.cc 2009-12-27 10:41:25 UTC (rev
9909)
+++ gnunet-qt/src/common/desktopServices.cc 2009-12-27 12:11:08 UTC (rev
9910)
@@ -18,8 +18,13 @@
Boston, MA 02111-1307, USA.
*/
+#include "config.h"
+#ifndef __WIN32__
#include <QDesktopServices>
+#include <QUrl>
+#else
#include <windows.h>
+#endif
#include "desktopServices.h"
/**
@@ -33,17 +38,17 @@
* @param strPath path to the file
* @return true on success
*/
-bool GDesktopServices::openDocument(QString strPath)
+bool GDesktopServices::openDocument(const char *strPath)
{
-#if defined(Q_OS_WIN32)
+#ifdef __WIN32__
// Qt 4.2 URL encodes files which is not understood by Windows, so
// we call ShellExecute directly instead of openUrl()
- return ((unsigned int) ShellExecuteA(0, 0, qPrintable(strPath), 0, 0,
SW_SHOWNORMAL)) > 32;
+ return ((unsigned int) ShellExecuteA(0, 0, strPath, 0, 0, SW_SHOWNORMAL)) >
32;
#else
QUrl url;
url.setScheme("file");
- url.setPath(strPath);
+ url.setPath(QString(strPath));
return QDesktopServices::openUrl(url);
#endif
Modified: gnunet-qt/src/common/desktopServices.h
===================================================================
--- gnunet-qt/src/common/desktopServices.h 2009-12-27 10:41:25 UTC (rev
9909)
+++ gnunet-qt/src/common/desktopServices.h 2009-12-27 12:11:08 UTC (rev
9910)
@@ -32,5 +32,5 @@
* @param strPath path to the file
* @return true on success
*/
- static bool openDocument(QString strPath);
+ static bool openDocument(const char *strPath);
};
Modified: gnunet-qt/src/plugins/fs/fs.cc
===================================================================
--- gnunet-qt/src/plugins/fs/fs.cc 2009-12-27 10:41:25 UTC (rev 9909)
+++ gnunet-qt/src/plugins/fs/fs.cc 2009-12-27 12:11:08 UTC (rev 9910)
@@ -285,7 +285,7 @@
QFileInfo info(name);
// Open file
- GDesktopServices::openDocument(info.absoluteFilePath());
+ GDesktopServices::openDocument(qPrintable(info.absoluteFilePath()));
}
}
}
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [GNUnet-SVN] r9910 - in gnunet-qt/src: common plugins/fs,
gnunet <=