mirror of
https://github.com/chylex/Nextcloud-Desktop.git
synced 2026-04-03 09:11:33 +02:00
Compare commits
11 Commits
techprevie
...
techprevie
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
b1667f48d3 | ||
|
|
33f9ae827f | ||
|
|
ef4541f834 | ||
|
|
1b6a9bf128 | ||
|
|
7956f2846b | ||
|
|
12a5f2d16a | ||
|
|
817e92ab7a | ||
|
|
f4cd3b95c5 | ||
|
|
a106f89d29 | ||
|
|
322b2fe3a5 | ||
|
|
33520fdee8 |
@@ -35,6 +35,7 @@
|
||||
#include "filesystem.h"
|
||||
#include "clientsideencryptionjobs.h"
|
||||
#include "syncresult.h"
|
||||
#include "vfs_windows.h"
|
||||
|
||||
#include <math.h>
|
||||
|
||||
@@ -1164,6 +1165,10 @@ void AccountSettings::slotDeleteAccount()
|
||||
|
||||
// IMPORTANT: "this" is deleted from this point on. We should probably remove this synchronous
|
||||
// .exec() QMessageBox magic above as it recurses into the event loop.
|
||||
|
||||
#if defined(Q_OS_WIN)
|
||||
VfsWindows::instance()->unmount();
|
||||
#endif
|
||||
}
|
||||
|
||||
bool AccountSettings::event(QEvent *e)
|
||||
|
||||
@@ -263,32 +263,27 @@ Application::~Application()
|
||||
|
||||
// Remove the account from the account manager so it can be deleted.
|
||||
AccountManager::instance()->shutdown();
|
||||
#if defined(Q_OS_MAC)
|
||||
if(cont)
|
||||
cont->unmount();
|
||||
#endif
|
||||
|
||||
#if defined(Q_OS_WIN)
|
||||
Vfs_windows *_Vfs_windows = NULL;
|
||||
_Vfs_windows = Vfs_windows::instance();
|
||||
if (_Vfs_windows) {
|
||||
qDebug() << Q_FUNC_INFO << " Up drive: " << _Vfs_windows;
|
||||
WCHAR DriveLetter = L'X';
|
||||
_Vfs_windows->downDrive(DriveLetter);
|
||||
} else
|
||||
qDebug() << Q_FUNC_INFO << " Bad up drive";
|
||||
VfsWindows::instance()->unmount();
|
||||
#endif
|
||||
|
||||
#if defined(Q_OS_MAC)
|
||||
VfsMacController::instance()->unmount();
|
||||
#endif
|
||||
}
|
||||
|
||||
void Application::slotAccountStateRemoved(AccountState *accountState)
|
||||
{
|
||||
if (_cronDeleteOnlineFiles)
|
||||
/*
|
||||
if (_cronDeleteOnlineFiles)
|
||||
{
|
||||
disconnect(_cronDeleteOnlineFiles, SIGNAL(timeout()), this, SLOT(slotDeleteOnlineFiles()));
|
||||
_cronDeleteOnlineFiles->stop();
|
||||
delete _cronDeleteOnlineFiles;
|
||||
_cronDeleteOnlineFiles = NULL;
|
||||
}
|
||||
*/
|
||||
|
||||
if (_gui) {
|
||||
disconnect(accountState, &AccountState::stateChanged,
|
||||
@@ -296,21 +291,7 @@ void Application::slotAccountStateRemoved(AccountState *accountState)
|
||||
disconnect(accountState->account().data(), &Account::serverVersionChanged,
|
||||
_gui.data(), &ownCloudGui::slotTrayMessageIfServerUnsupported);
|
||||
}
|
||||
#if defined(Q_OS_MAC)
|
||||
if(cont)
|
||||
cont->unmount();
|
||||
#endif
|
||||
|
||||
#if defined(Q_OS_WIN)
|
||||
Vfs_windows *_Vfs_windows = NULL;
|
||||
_Vfs_windows = Vfs_windows::instance();
|
||||
if (_Vfs_windows) {
|
||||
qDebug() << Q_FUNC_INFO << " Up drive: " << _Vfs_windows;
|
||||
WCHAR DriveLetter = L'X';
|
||||
_Vfs_windows->downDrive(DriveLetter);
|
||||
} else
|
||||
qDebug() << Q_FUNC_INFO << " Bad up drive";
|
||||
#endif
|
||||
if (_folderManager) {
|
||||
disconnect(accountState, &AccountState::stateChanged,
|
||||
_folderManager.data(), &FolderMan::slotAccountStateChanged);
|
||||
@@ -340,53 +321,27 @@ void Application::slotAccountStateAdded(AccountState *accountState)
|
||||
_gui->slotTrayMessageIfServerUnsupported(accountState->account().data());
|
||||
|
||||
// Mount the virtual FileSystem.
|
||||
#if defined(Q_OS_MAC)
|
||||
ConfigFile cfgFile;
|
||||
cont = new VfsMacController(cfgFile.defaultFileStreamMirrorPath(), cfgFile.defaultFileStreamSyncPath(), accountState, this);
|
||||
#endif
|
||||
|
||||
#if defined(Q_OS_MAC)
|
||||
QString rootPath = QStandardPaths::writableLocation(QStandardPaths::AppConfigLocation) + "/.cachedFiles";
|
||||
QString mountPath = "/Volumes/" + _theme->appName() + "fs";
|
||||
VfsMacController::instance()->initialize(rootPath, mountPath, accountState);
|
||||
VfsMacController::instance()->mount();
|
||||
#endif
|
||||
|
||||
#if defined(Q_OS_WIN)
|
||||
ConfigFile cfgFile;
|
||||
QDir pathDir(cfgFile.defaultFileStreamMirrorPath());
|
||||
while (!pathDir.exists())
|
||||
{
|
||||
qDebug() << "\n dbg_dokan " << Q_FUNC_INFO << " !pathDir.exists() 3-0" << cfgFile.defaultFileStreamMirrorPath();
|
||||
pathDir.mkdir(cfgFile.defaultFileStreamMirrorPath());
|
||||
SetFileAttributes((const wchar_t *) cfgFile.defaultFileStreamMirrorPath().utf16(), FILE_ATTRIBUTE_HIDDEN);
|
||||
Sleep(100);
|
||||
}
|
||||
|
||||
Vfs_windows *_Vfs_windows = NULL;
|
||||
_Vfs_windows = new Vfs_windows(accountState);
|
||||
|
||||
if (_Vfs_windows)
|
||||
{
|
||||
qDebug() << "\n dbg_sync " << Q_FUNC_INFO << " Up drive: " << Vfs_windows::instance();
|
||||
_Vfs_windows->upDrive(cfgFile.defaultFileStreamMirrorPath(), cfgFile.defaultFileStreamLetterDrive());
|
||||
Sleep(1000);
|
||||
cfgFile.createAuxiliarDirectories();
|
||||
|
||||
/* Current owncloudgui::slotLogout */
|
||||
//WCHAR DriveLetter = L'X';
|
||||
//connect(this, SIGNAL(aboutToQuit()), _Vfs_windows, SLOT(unmount(DriveLetter)));
|
||||
|
||||
/* Current QuotaInfo::slotUpdateLastQuota */
|
||||
//QuotaInfo _quotaInfo(accountState);
|
||||
//connect(&_quotaInfo, SIGNAL(quotaUpdated(qint64, qint64)), _Vfs_windows, SLOT(quoting(qint64, qint64)));
|
||||
}
|
||||
else
|
||||
qDebug() << "\n dbg_sync " << Q_FUNC_INFO << " Bad up drive";
|
||||
QString rootPath = QStandardPaths::writableLocation(QStandardPaths::AppDataLocation) + "/cachedFiles/";
|
||||
WCHAR mountLetter = L'X';
|
||||
VfsWindows::instance()->initialize(rootPath, mountLetter, accountState);
|
||||
VfsWindows::instance()->mount();
|
||||
#endif
|
||||
|
||||
//< For cron delete dir/files online. Execute each 60000 msec
|
||||
|
||||
//< Uncomment for test "Clean local folder" case.
|
||||
//< Uncomment for test "Clean local folder" case.
|
||||
/*_cronDeleteOnlineFiles = new QTimer(this);
|
||||
connect(_cronDeleteOnlineFiles, SIGNAL(timeout()), this, SLOT(slotDeleteOnlineFiles()));
|
||||
_cronDeleteOnlineFiles->start(60000);
|
||||
*/
|
||||
|
||||
|
||||
/* See SocketApi::command_SET_DOWNLOAD_MODE
|
||||
//< Dummy example; Not uncomment
|
||||
@@ -843,6 +798,4 @@ void Application::showSettingsDialog()
|
||||
_gui->slotShowSettings();
|
||||
}
|
||||
|
||||
|
||||
} // namespace OCC
|
||||
|
||||
} // namespace OCC
|
||||
@@ -126,11 +126,18 @@ int FolderMan::unloadAndDeleteAllFolders()
|
||||
{
|
||||
int cnt = 0;
|
||||
|
||||
unloadFolder();
|
||||
_folderMap.clear();
|
||||
// clear the list of existing folders.
|
||||
Folder::MapIterator i(_folderMap);
|
||||
while (i.hasNext()) {
|
||||
i.next();
|
||||
Folder *f = i.value();
|
||||
unloadFolder();
|
||||
delete f;
|
||||
cnt++;
|
||||
}
|
||||
ASSERT(_folderMap.isEmpty());
|
||||
|
||||
_currentSyncFolder = nullptr;
|
||||
_currentSyncFolder = 0;
|
||||
_scheduledFolders.clear();
|
||||
emit folderListChanged(_folderMap);
|
||||
emit scheduleQueueChanged();
|
||||
@@ -658,8 +665,7 @@ void FolderMan::startScheduledSyncSoon()
|
||||
if (thread() != QThread::currentThread())
|
||||
slotStartScheduledFolderSync();
|
||||
else
|
||||
_startScheduledSyncTimer.start(msDelay);
|
||||
|
||||
_startScheduledSyncTimer.start(msDelay);
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -730,13 +736,27 @@ void FolderMan::slotEtagPollTimerTimeout()
|
||||
|
||||
void FolderMan::slotRemoveFoldersForAccount(AccountState *accountState)
|
||||
{
|
||||
removeFolder();
|
||||
QVarLengthArray<Folder *, 16> foldersToRemove;
|
||||
Folder::MapIterator i(_folderMap);
|
||||
while (i.hasNext()) {
|
||||
i.next();
|
||||
Folder *folder = i.value();
|
||||
if (folder->accountState() == accountState) {
|
||||
foldersToRemove.append(folder);
|
||||
}
|
||||
}
|
||||
|
||||
foreach (const auto &f, foldersToRemove) {
|
||||
removeFolder();
|
||||
}
|
||||
emit folderListChanged(_folderMap);
|
||||
}
|
||||
|
||||
void FolderMan::slotForwardFolderSyncStateChange()
|
||||
{
|
||||
emit folderSyncStateChange();
|
||||
if (Folder *f = qobject_cast<Folder *>(sender())) {
|
||||
emit folderSyncStateChange();
|
||||
}
|
||||
}
|
||||
|
||||
void FolderMan::slotServerVersionChanged(Account *account)
|
||||
@@ -826,7 +846,7 @@ void FolderMan::slotFolderSyncFinished(const SyncResult &)
|
||||
qPrintable(_currentSyncFolder->remoteUrl().toString()));
|
||||
|
||||
//TODO FUSE
|
||||
//_currentSyncFolder = nullptr;
|
||||
//_currentSyncFolder = 0;
|
||||
|
||||
startScheduledSyncSoon();
|
||||
}
|
||||
@@ -943,14 +963,15 @@ void FolderMan::removeFolder()
|
||||
|
||||
qCInfo(lcFolderMan) << "Removing " << _currentSyncFolder->alias();
|
||||
|
||||
const bool currentlyRunning = _currentSyncFolder->isBusy();
|
||||
const bool currentlyRunning = _currentSyncFolder;
|
||||
if (currentlyRunning) {
|
||||
// abort the sync now
|
||||
terminateSyncProcess();
|
||||
}
|
||||
|
||||
_scheduledFolders.clear();
|
||||
emit scheduleQueueChanged();
|
||||
if (_scheduledFolders.removeAll(_currentSyncFolder)>0){
|
||||
emit scheduleQueueChanged();
|
||||
}
|
||||
|
||||
_currentSyncFolder->wipe();
|
||||
_currentSyncFolder->setSyncPaused(true);
|
||||
|
||||
@@ -187,7 +187,6 @@ void GeneralSettings::slotToggleOptionalServerNotifications(bool enable)
|
||||
|
||||
#ifdef Q_OS_WIN
|
||||
//< Set configuration paths.
|
||||
|
||||
QString m_defaultFileStreamSyncPath = cfgFile.defaultFileStreamSyncPath();
|
||||
QString m_defaultFileStreamMirrorPath = cfgFile.defaultFileStreamMirrorPath();
|
||||
QString m_defaultFileStreamLetterDrive = cfgFile.defaultFileStreamLetterDrive();
|
||||
|
||||
@@ -1007,22 +1007,13 @@ void ownCloudGui::slotLogout()
|
||||
ai->signOutByUi();
|
||||
}
|
||||
|
||||
/*
|
||||
* JP 09/2018.
|
||||
* Down Virtual File System.
|
||||
*/
|
||||
#if defined(Q_OS_WIN)
|
||||
Vfs_windows *_Vfs_windows = NULL;
|
||||
_Vfs_windows = Vfs_windows::instance();
|
||||
if (_Vfs_windows)
|
||||
{
|
||||
qDebug() << "\n dbg_sync " << Q_FUNC_INFO << "up Drive: " << _Vfs_windows;
|
||||
WCHAR DriveLetter = L'X';
|
||||
_Vfs_windows->downDrive(DriveLetter);
|
||||
}
|
||||
else
|
||||
qDebug() << "\n dbg_sync " << Q_FUNC_INFO << " BAD up Drive";
|
||||
#endif
|
||||
#if defined(Q_OS_WIN)
|
||||
VfsWindows::instance()->unmount();
|
||||
#endif
|
||||
|
||||
#if defined(Q_OS_MAC)
|
||||
VfsMacController::instance()->unmount();
|
||||
#endif
|
||||
}
|
||||
|
||||
void ownCloudGui::slotUnpauseAllFolders()
|
||||
|
||||
@@ -336,6 +336,10 @@ void OwncloudSetupWizard::slotConnectToOCUrl(const QString &url)
|
||||
.arg(url));
|
||||
|
||||
testOwnCloudConnect();
|
||||
|
||||
emit _ocWizard->basicSetupFinished(1);
|
||||
_ocWizard->close();
|
||||
emit ownCloudWizardDone(0);
|
||||
}
|
||||
|
||||
void OwncloudSetupWizard::testOwnCloudConnect()
|
||||
|
||||
@@ -120,13 +120,8 @@ void QuotaInfo::slotUpdateLastQuota(const QVariantMap &result)
|
||||
_lastQuotaTotalBytes = avail >= 0 ? _lastQuotaUsedBytes + avail : avail;
|
||||
|
||||
#if defined(Q_OS_WIN)
|
||||
Vfs_windows *m_Vfs_windows = NULL;
|
||||
m_Vfs_windows = Vfs_windows::instance();
|
||||
if (m_Vfs_windows)
|
||||
{
|
||||
m_Vfs_windows->DsetTotalNumberOfBytes((unsigned long long)_lastQuotaTotalBytes);
|
||||
m_Vfs_windows->DsetTotalNumberOfFreeBytes((unsigned long long)_lastQuotaUsedBytes);
|
||||
}
|
||||
VfsWindows::instance()->setNumberOfBytes((unsigned long long)_lastQuotaTotalBytes);
|
||||
VfsWindows::instance()->setNumberOfFreeBytes((unsigned long long)_lastQuotaUsedBytes);
|
||||
#endif
|
||||
|
||||
emit quotaUpdated(_lastQuotaTotalBytes, _lastQuotaUsedBytes);
|
||||
|
||||
@@ -343,16 +343,16 @@ void SocketApi::slotUnregisterPath(const QString &alias)
|
||||
return;
|
||||
|
||||
Folder *f = FolderMan::instance()->folder(alias);
|
||||
if (f)
|
||||
{
|
||||
if (f)
|
||||
{
|
||||
#if defined(Q_OS_WIN)
|
||||
ConfigFile Cfg;
|
||||
QString FileStreamLetterDrive = Cfg.defaultFileStreamLetterDrive().toUpper().append(":/");
|
||||
broadcastMessage(buildMessage(QLatin1String("UNREGISTER_PATH"), FileStreamLetterDrive, QString()), true);
|
||||
ConfigFile Cfg;
|
||||
QString FileStreamLetterDrive = Cfg.defaultFileStreamLetterDrive().toUpper().append(":/");
|
||||
broadcastMessage(buildMessage(QLatin1String("UNREGISTER_PATH"), FileStreamLetterDrive, QString()), true);
|
||||
#elif defined(Q_OS_MAC)
|
||||
broadcastMessage(buildMessage(QLatin1String("UNREGISTER_PATH"), removeTrailingSlash(f->path()), QString()), true);
|
||||
broadcastMessage(buildMessage(QLatin1String("UNREGISTER_PATH"), removeTrailingSlash(f->path()), QString()), true);
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
||||
_registeredAliases.remove(alias);
|
||||
}
|
||||
@@ -375,13 +375,13 @@ void SocketApi::slotUpdateFolderView()
|
||||
QString rootPath = removeTrailingSlash(f->path());
|
||||
|
||||
#if defined(Q_OS_WIN)
|
||||
ConfigFile Cfg;
|
||||
QString FileStreamLetterDrive = Cfg.defaultFileStreamLetterDrive().toUpper().append(":");
|
||||
broadcastStatusPushMessage(FileStreamLetterDrive, f->syncEngine().syncFileStatusTracker().fileStatus(""));
|
||||
broadcastMessage(buildMessage(QLatin1String("UPDATE_VIEW"), FileStreamLetterDrive.append("/")));
|
||||
ConfigFile Cfg;
|
||||
QString FileStreamLetterDrive = Cfg.defaultFileStreamLetterDrive().toUpper().append(":");
|
||||
broadcastStatusPushMessage(FileStreamLetterDrive, f->syncEngine().syncFileStatusTracker().fileStatus(""));
|
||||
broadcastMessage(buildMessage(QLatin1String("UPDATE_VIEW"), FileStreamLetterDrive.append("/")));
|
||||
#elif defined(Q_OS_MAC)
|
||||
broadcastStatusPushMessage(rootPath, f->syncEngine().syncFileStatusTracker().fileStatus(""));
|
||||
broadcastMessage(buildMessage(QLatin1String("UPDATE_VIEW"), rootPath));
|
||||
broadcastStatusPushMessage(rootPath, f->syncEngine().syncFileStatusTracker().fileStatus(""));
|
||||
broadcastMessage(buildMessage(QLatin1String("UPDATE_VIEW"), rootPath));
|
||||
#endif
|
||||
} else {
|
||||
qCDebug(lcSocketApi) << "Not sending UPDATE_VIEW for" << f->alias() << "because status() is" << f->syncResult().status();
|
||||
@@ -454,8 +454,8 @@ void SocketApi::broadcastStatusPushMessage(const QString &systemPath, SyncFileSt
|
||||
QString msg = buildMessage(QLatin1String("STATUS"), systemPath, fileStatus.toSocketAPIString());
|
||||
Q_ASSERT(!systemPath.endsWith('/'));
|
||||
#if defined(Q_OS_WIN)
|
||||
ConfigFile Cfg;
|
||||
QString FileStreamLetterDrive = Cfg.defaultFileStreamLetterDrive().toUpper().append("://");
|
||||
ConfigFile Cfg;
|
||||
QString FileStreamLetterDrive = Cfg.defaultFileStreamLetterDrive().toUpper().append("://");
|
||||
uint directoryHash = qHash(systemPath.left(FileStreamLetterDrive.lastIndexOf('/')));
|
||||
#elif defined(Q_OS_MAC)
|
||||
uint directoryHash = qHash(systemPath.left(systemPath.lastIndexOf('/')));
|
||||
@@ -466,9 +466,9 @@ void SocketApi::broadcastStatusPushMessage(const QString &systemPath, SyncFileSt
|
||||
QString systemPath2 = systemPath;
|
||||
systemPath2.replace(0, relative_prefix.length(), Cfg.defaultFileStreamLetterDrive().toUpper().append(":"));
|
||||
QString msg2 = buildMessage(QLatin1String("STATUS"), systemPath2, fileStatus.toSocketAPIString());
|
||||
listener.sendMessageIfDirectoryMonitored(msg2, directoryHash);
|
||||
listener.sendMessageIfDirectoryMonitored(msg2, directoryHash);
|
||||
#elif defined(Q_OS_MAC)
|
||||
listener.sendMessageIfDirectoryMonitored(msg, directoryHash);
|
||||
listener.sendMessageIfDirectoryMonitored(msg, directoryHash);
|
||||
#endif
|
||||
}
|
||||
}
|
||||
@@ -481,11 +481,11 @@ void SocketApi::command_RETRIEVE_FOLDER_STATUS(const QString &argument, SocketLi
|
||||
|
||||
void SocketApi::command_RETRIEVE_FILE_STATUS(const QString &argumentC, SocketListener *listener)
|
||||
{
|
||||
QString argument = argumentC;
|
||||
QString relative_prefix = QStandardPaths::writableLocation(QStandardPaths::AppDataLocation) + "/cachedFiles/";
|
||||
argument.replace(0, 3, relative_prefix);
|
||||
QString argument = argumentC;
|
||||
QString relative_prefix = QStandardPaths::writableLocation(QStandardPaths::AppDataLocation) + "/cachedFiles/";
|
||||
argument.replace(0, 3, relative_prefix);
|
||||
|
||||
QString statusString;
|
||||
QString statusString;
|
||||
|
||||
auto fileData = FileData::get(argument);
|
||||
if (!fileData.folder) {
|
||||
@@ -501,19 +501,19 @@ void SocketApi::command_RETRIEVE_FILE_STATUS(const QString &argumentC, SocketLis
|
||||
// Let the listener know that it should now send status pushes for sibblings of this file.
|
||||
QString directory = fileData.localPath.left(fileData.localPath.lastIndexOf('/'));
|
||||
#if defined(Q_OS_WIN)
|
||||
ConfigFile Cfg;
|
||||
QString FileStreamLetterDrive = Cfg.defaultFileStreamLetterDrive().toUpper().append("://");
|
||||
listener->registerMonitoredDirectory(qHash(FileStreamLetterDrive));
|
||||
ConfigFile Cfg;
|
||||
QString FileStreamLetterDrive = Cfg.defaultFileStreamLetterDrive().toUpper().append("://");
|
||||
listener->registerMonitoredDirectory(qHash(FileStreamLetterDrive));
|
||||
#elif defined(Q_OS_MAC)
|
||||
listener->registerMonitoredDirectory(qHash(directory));
|
||||
listener->registerMonitoredDirectory(qHash(directory));
|
||||
#endif
|
||||
SyncFileStatus fileStatus = fileData.syncFileStatus();
|
||||
statusString = fileStatus.toSocketAPIString();
|
||||
}
|
||||
|
||||
//QString message2 = message;
|
||||
//QString relative_prefix = QStandardPaths::writableLocation(QStandardPaths::AppDataLocation) + "/cachedFiles/";
|
||||
argument.replace(0, relative_prefix.length(), QString("X:\\"));
|
||||
//QString message2 = message;
|
||||
//QString relative_prefix = QStandardPaths::writableLocation(QStandardPaths::AppDataLocation) + "/cachedFiles/";
|
||||
argument.replace(0, relative_prefix.length(), QString("X:\\"));
|
||||
|
||||
const QString message = QLatin1String("STATUS:") % statusString % QLatin1Char(':') % QDir::toNativeSeparators(argument);
|
||||
|
||||
@@ -523,7 +523,7 @@ void SocketApi::command_RETRIEVE_FILE_STATUS(const QString &argumentC, SocketLis
|
||||
void SocketApi::command_SHARE(const QString &localFileC, SocketListener *listener)
|
||||
{
|
||||
QString localFile = localFileC;
|
||||
|
||||
|
||||
#if defined(Q_OS_WIN)
|
||||
OCC::ConfigFile Cfg;
|
||||
char letter[2];
|
||||
@@ -954,8 +954,8 @@ void SocketApi::sendSharingContextMenuOptions(const FileData &fileData, SocketLi
|
||||
// If sharing is globally disabled, do not show any sharing entries.
|
||||
// If there is no permission to share for this file, add a disabled entry saying so
|
||||
|
||||
listener->sendMessage(QLatin1String("MENU_ITEM:OFFLINE_DOWNLOAD_MODE") + flagString + tr("0ff line"));
|
||||
listener->sendMessage(QLatin1String("MENU_ITEM:ONLINE_DOWNLOAD_MODE") + flagString + tr("On line"));
|
||||
listener->sendMessage(QLatin1String("MENU_ITEM:OFFLINE_DOWNLOAD_MODE") + flagString + tr("0ffline"));
|
||||
listener->sendMessage(QLatin1String("MENU_ITEM:ONLINE_DOWNLOAD_MODE") + flagString + tr("Online"));
|
||||
|
||||
if (isOnTheServer && !record._remotePerm.isNull() && !record._remotePerm.hasPermission(RemotePermissions::CanReshare)) {
|
||||
listener->sendMessage(QLatin1String("MENU_ITEM:DISABLED:d:") + tr("Resharing this file is not allowed"));
|
||||
@@ -1064,10 +1064,10 @@ void SocketApi::command_GET_MENU_ITEMS(const QString &argumentC, OCC::SocketList
|
||||
QString SocketApi::buildRegisterPathMessage(const QString &pathC)
|
||||
{
|
||||
#if defined(Q_OS_WIN)
|
||||
ConfigFile Cfg;
|
||||
QString path = Cfg.defaultFileStreamLetterDrive().toUpper().append(":/");
|
||||
ConfigFile Cfg;
|
||||
QString path = Cfg.defaultFileStreamLetterDrive().toUpper().append(":/");
|
||||
#elif defined(Q_OS_MAC)
|
||||
QString path = pathC;
|
||||
QString path = pathC;
|
||||
#endif
|
||||
QFileInfo fi(path);
|
||||
QString message = QLatin1String("REGISTER_PATH:");
|
||||
@@ -1099,7 +1099,7 @@ void SocketApi::command_ONLINE_DOWNLOAD_MODE(const QString &path, SocketListener
|
||||
QString relative_prefix = cfg.defaultFileStreamMirrorPath();
|
||||
QString relative_path = path;
|
||||
relative_path = relative_path.replace(0, relative_prefix.length(), QString(""));
|
||||
|
||||
|
||||
qDebug() << "\n" << Q_FUNC_INFO << "ONLINE_DOWNLOAD_MODE: " << relative_path;
|
||||
SyncJournalDb::instance()->setSyncMode(relative_path, SyncJournalDb::SYNCMODE_ONLINE);
|
||||
//< Example
|
||||
@@ -1230,9 +1230,8 @@ void SocketApi::command_GET_DOWNLOAD_MODE(const QString &localFileC, SocketListe
|
||||
localFile.replace(0, 3, QString(""));
|
||||
localFile.replace("\\", "/");
|
||||
#elif defined(Q_OS_MAC)
|
||||
ConfigFile cfg;
|
||||
QString relative_prefix = cfg.defaultFileStreamMirrorPath();
|
||||
localFile = localFile.replace(0, relative_prefix.length(), QString(""));
|
||||
QString relative_prefix = cfgFile.getFsMirrorPath();
|
||||
localFile = localFile.replace(0, relative_prefix.length(), QString(""));
|
||||
#endif
|
||||
|
||||
qDebug() << Q_FUNC_INFO << " localFile_0: " << localFile;
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -25,29 +25,40 @@
|
||||
|
||||
#include <QMutex>
|
||||
#include <QWaitCondition>
|
||||
#include <QRunnable>
|
||||
#include <QThreadPool>
|
||||
#include <QStorageInfo>
|
||||
#include "syncwrapper.h"
|
||||
|
||||
namespace OCC {
|
||||
|
||||
class Vfs_windows : public QObject
|
||||
class CleanIgnoredTask : public QObject, public QRunnable
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
void run();
|
||||
};
|
||||
|
||||
class VfsWindows : public QObject
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
static Vfs_windows* instance();
|
||||
~VfsWindows();
|
||||
static VfsWindows *instance();
|
||||
void initialize(QString rootPath, WCHAR mountLetter, AccountState *accountState);
|
||||
void mount();
|
||||
void unmount();
|
||||
bool removeRecursively(const QString &dirName);
|
||||
bool removeDir();
|
||||
|
||||
Vfs_windows(AccountState *);
|
||||
~Vfs_windows();
|
||||
void upDrive(QString, QString);
|
||||
void downDrive(WCHAR DriveLetter);
|
||||
bool removeDir(const QString &);
|
||||
void setNumberOfBytes(unsigned long long numberOfBytes);
|
||||
unsigned long long getNumberOfBytes();
|
||||
|
||||
void DsetTotalNumberOfBytes(unsigned long long n);
|
||||
unsigned long long DgetTotalNumberOfBytes();
|
||||
|
||||
void DsetTotalNumberOfFreeBytes(unsigned long long n);
|
||||
unsigned long long DgetTotalNumberOfFreeBytes();
|
||||
void setNumberOfFreeBytes(unsigned long long numberOfFreeBytes);
|
||||
unsigned long long getNumberOfFreeBytes();
|
||||
|
||||
QStringList* contentsOfDirectoryAtPath(QString path, QVariantMap &error);
|
||||
QList<QString> ignoredList;
|
||||
|
||||
void createFileAtPath(QString path, QVariantMap &error);
|
||||
void moveFileAtPath(QString path, QString npath,QVariantMap &error);
|
||||
@@ -61,10 +72,23 @@ public:
|
||||
void endDeleteDirectoryAtPath(QString path, QVariantMap &error);
|
||||
|
||||
private:
|
||||
static Vfs_windows *_instance;
|
||||
QMap<QString, OCC::DiscoveryDirectoryResult*> _fileListMap;
|
||||
QPointer<OCC::DiscoveryFolderFileList> _remotefileListJob;
|
||||
QString rootPath_;
|
||||
VfsWindows();
|
||||
QList<QString> getLogicalDrives();
|
||||
static VfsWindows *_instance;
|
||||
QMap<QString, OCC::DiscoveryDirectoryResult *> _fileListMap;
|
||||
QPointer<OCC::DiscoveryFolderFileList> _remotefileListJob;
|
||||
QString rootPath;
|
||||
WCHAR mountLetter;
|
||||
|
||||
// @Capacity
|
||||
//*TotalNumberOfBytes = (ULONGLONG)1024L * 1024 * 1024 * 50;
|
||||
unsigned long long numberOfBytes = 0;
|
||||
// @Used space
|
||||
//*TotalNumberOfFreeBytes = (ULONGLONG)1024L * 1024 * 10;
|
||||
unsigned long long numberOfFreeBytes = 0;
|
||||
// @Free space
|
||||
//*FreeBytesAvailable = (ULONGLONG)(*TotalNumberOfBytes - *TotalNumberOfFreeBytes); / *1024 * 1024 * 10;
|
||||
unsigned long long freeBytesAvailable = 0;
|
||||
|
||||
// To sync
|
||||
OCC::SyncWrapper *_syncWrapper;
|
||||
@@ -92,5 +116,4 @@ public slots:
|
||||
|
||||
} // namespace OCC
|
||||
|
||||
#endif // VFS_WINDOWS_H
|
||||
|
||||
#endif // VFS_WINDOWS_H
|
||||
Reference in New Issue
Block a user