1
0
mirror of https://github.com/chylex/Nextcloud-Desktop.git synced 2026-04-15 12:44:08 +02:00

Compare commits

...

5 Commits

Author SHA1 Message Date
Klaas Freitag
b3620e320b Avoid a comparison warning on win32 2013-12-03 17:09:57 +01:00
Klaas Freitag
883576cb95 Fix Win32 move file operation. 2013-12-03 17:07:42 +01:00
Daniel Molkentin
62ec7aa9c5 Add file forgotten in last commit 2013-12-03 16:24:17 +01:00
Daniel Molkentin
99fc570267 Replace Q_OS_WIN32 by Q_OS_WIN
Fixes #1238
2013-12-03 16:23:49 +01:00
Olivier Goffart
1f5c4bde14 Fix windows rename of temporary files 2013-12-03 16:10:44 +01:00
7 changed files with 20 additions and 13 deletions

View File

@@ -36,7 +36,7 @@ int main(int argc, char **argv)
Mirall::Application app(argc, argv); Mirall::Application app(argc, argv);
app.initialize(); app.initialize();
#ifndef Q_OS_WIN32 #ifndef Q_OS_WIN
signal(SIGPIPE, SIG_IGN); signal(SIGPIPE, SIG_IGN);
#endif #endif
if( app.giveHelp() ) { if( app.giveHelp() ) {

View File

@@ -390,7 +390,7 @@ void AccountSettings::slotFolderOpenAction( const QString& alias )
QUrl url(f->path(), QUrl::TolerantMode); QUrl url(f->path(), QUrl::TolerantMode);
url.setScheme( QLatin1String("file") ); url.setScheme( QLatin1String("file") );
#ifdef Q_OS_WIN32 #ifdef Q_OS_WIN
// work around a bug in QDesktopServices on Win32, see i-net // work around a bug in QDesktopServices on Win32, see i-net
QString filePath = f->path(); QString filePath = f->path();
@@ -490,7 +490,7 @@ void AccountSettings::slotUpdateFolderState( Folder *folder )
//void AccountSettings::slotOCInfo( const QString& url, const QString& versionStr, const QString& version, const QString& ) //void AccountSettings::slotOCInfo( const QString& url, const QString& versionStr, const QString& version, const QString& )
//{ //{
//#ifdef Q_OS_WIN32 //#ifdef Q_OS_WIN
// // work around a bug in QDesktopServices on Win32, see i-net // // work around a bug in QDesktopServices on Win32, see i-net
// QString filePath = url; // QString filePath = url;

View File

@@ -69,7 +69,7 @@ QString applicationTrPath()
#ifdef Q_OS_MAC #ifdef Q_OS_MAC
return QApplication::applicationDirPath()+QLatin1String("/../Resources/Translations"); // path defaults to app dir. return QApplication::applicationDirPath()+QLatin1String("/../Resources/Translations"); // path defaults to app dir.
#endif #endif
#ifdef Q_OS_WIN32 #ifdef Q_OS_WIN
return QApplication::applicationDirPath(); return QApplication::applicationDirPath();
#endif #endif
} }

View File

@@ -326,7 +326,7 @@ void ownCloudGui::slotFolderOpenAction( const QString& alias )
QUrl url(f->path(), QUrl::TolerantMode); QUrl url(f->path(), QUrl::TolerantMode);
url.setScheme( QLatin1String("file") ); url.setScheme( QLatin1String("file") );
#ifdef Q_OS_WIN32 #ifdef Q_OS_WIN
// work around a bug in QDesktopServices on Win32, see i-net // work around a bug in QDesktopServices on Win32, see i-net
QString filePath = f->path(); QString filePath = f->path();

View File

@@ -41,6 +41,11 @@
#include <time.h> #include <time.h>
#ifdef Q_OS_WIN
#include <windef.h>
#include <winbase.h>
#endif
// We use some internals of csync: // We use some internals of csync:
extern "C" int c_utimes(const char *, const struct timeval *); extern "C" int c_utimes(const char *, const struct timeval *);
extern "C" void csync_win32_set_file_hidden( const char *file, bool h ); extern "C" void csync_win32_set_file_hidden( const char *file, bool h );
@@ -333,7 +338,7 @@ void PropagateUploadFile::start()
state = hbf_splitlist(trans.data(), file.handle()); state = hbf_splitlist(trans.data(), file.handle());
if (progressInfo._valid) { if (progressInfo._valid) {
if (progressInfo._modtime.toTime_t() == _item._modtime) { if (progressInfo._modtime.toTime_t() == (uint)_item._modtime) {
trans->start_id = progressInfo._chunk; trans->start_id = progressInfo._chunk;
trans->transfer_id = progressInfo._transferid; trans->transfer_id = progressInfo._transferid;
} }
@@ -786,7 +791,7 @@ void PropagateDownloadFile::start()
csync_win32_set_file_hidden(tmpFileName.toUtf8().constData(), false); csync_win32_set_file_hidden(tmpFileName.toUtf8().constData(), false);
#ifndef QT_OS_WIN #ifndef Q_OS_WIN
bool success; bool success;
#if QT_VERSION < QT_VERSION_CHECK(5, 0, 0) #if QT_VERSION < QT_VERSION_CHECK(5, 0, 0)
success = tmpFile.fileEngine()->rename(fn); success = tmpFile.fileEngine()->rename(fn);
@@ -804,10 +809,12 @@ void PropagateDownloadFile::start()
done(SyncFileItem::NormalError, tmpFile.errorString()); done(SyncFileItem::NormalError, tmpFile.errorString());
return; return;
} }
#else //QT_OS_WIN #else //Q_OS_WIN
if (::MoveFileEx((wchar_t*)tmpFile.fileName().utf16(), BOOL ok;
(wchar_t*)QString(_localDir + item._file).utf16(), ok = MoveFileEx((wchar_t*)tmpFile.fileName().utf16(),
MOVEFILE_REPLACE_EXISTING) != 0) { (wchar_t*)QString(_propagator->_localDir + _item._file).utf16(),
MOVEFILE_REPLACE_EXISTING+MOVEFILE_COPY_ALLOWED+MOVEFILE_WRITE_THROUGH);
if (!ok) {
wchar_t *string = 0; wchar_t *string = 0;
FormatMessage(FORMAT_MESSAGE_ALLOCATE_BUFFER|FORMAT_MESSAGE_FROM_SYSTEM, FormatMessage(FORMAT_MESSAGE_ALLOCATE_BUFFER|FORMAT_MESSAGE_FROM_SYSTEM,
NULL, ::GetLastError(), MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT), NULL, ::GetLastError(), MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT),

View File

@@ -48,7 +48,7 @@ void UpdateDetector::versionCheck( Theme *theme )
#ifdef Q_OS_LINUX #ifdef Q_OS_LINUX
platform = QLatin1String("linux"); platform = QLatin1String("linux");
#endif #endif
#ifdef Q_OS_WIN32 #ifdef Q_OS_WIN
platform = QLatin1String( "win32" ); platform = QLatin1String( "win32" );
#endif #endif
#ifdef Q_OS_MAC #ifdef Q_OS_MAC

View File

@@ -104,7 +104,7 @@ QString Utility::octetsToString( qint64 octets )
// Qtified version of get_platforms() in csync_owncloud.c // Qtified version of get_platforms() in csync_owncloud.c
QString Utility::platform() QString Utility::platform()
{ {
#if defined(Q_OS_WIN32) #if defined(Q_OS_WIN)
return QLatin1String("Windows"); return QLatin1String("Windows");
#elif defined(Q_OS_MAC) #elif defined(Q_OS_MAC)
return QLatin1String("Macintosh"); return QLatin1String("Macintosh");