Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/owncloud/client.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/src/gui
diff options
context:
space:
mode:
authorHannah von Reth <hannah.vonreth@owncloud.com>2022-06-24 16:06:34 +0300
committerFabian Müller <80399010+fmoc@users.noreply.github.com>2022-06-29 14:17:19 +0300
commit9b70ee3427fe7661a6f60de3e3016fbc4645058e (patch)
tree85ab3f91447f8488bb2b540e96b2da0a23cd9b8d /src/gui
parent5dfd970c6802fece8de82ff8f6f6f36f28662fe7 (diff)
Revert "Sync spaces to Spaces subfolder"
This reverts commit 0c4f977615fcd19ca46962b45ce15fcc912f51b6. Fixes: #9821
Diffstat (limited to 'src/gui')
-rw-r--r--src/gui/folderman.cpp2
-rw-r--r--src/gui/folderwizard/folderwizard.cpp4
-rw-r--r--src/gui/owncloudgui.cpp10
-rw-r--r--src/gui/spaces/spacesbrowser.cpp2
-rw-r--r--src/gui/spaces/spacesmodel.cpp6
-rw-r--r--src/gui/spaces/spacesmodel.h1
6 files changed, 7 insertions, 18 deletions
diff --git a/src/gui/folderman.cpp b/src/gui/folderman.cpp
index b2cbf6e0b..a8f3f083e 100644
--- a/src/gui/folderman.cpp
+++ b/src/gui/folderman.cpp
@@ -1318,7 +1318,7 @@ QString FolderMan::checkPathValidityForNewFolder(const QString &path) const
QString FolderMan::findGoodPathForNewSyncFolder(const QString &basePath) const
{
- QString folder = canonicalPath(basePath);
+ QString folder = basePath;
// If the parent folder is a sync folder or contained in one, we can't
// possibly find a valid sync folder inside it.
diff --git a/src/gui/folderwizard/folderwizard.cpp b/src/gui/folderwizard/folderwizard.cpp
index 8470e8199..8c4b14cf1 100644
--- a/src/gui/folderwizard/folderwizard.cpp
+++ b/src/gui/folderwizard/folderwizard.cpp
@@ -632,9 +632,7 @@ QString FolderWizard::destination() const
}
QString defaultPath = _account->defaultSyncRoot();
if (_account->capabilities().spacesSupport().enabled) {
- defaultPath += QDir::separator() + _spacesPage->selectedSpace(Spaces::SpacesModel::Columns::LocalMountPoint).toString();
- FolderMan::prepareFolder(defaultPath);
- defaultPath += QDir::separator() + _spacesPage->selectedSpace(Spaces::SpacesModel::Columns::Name).toString();
+ defaultPath += QLatin1Char('/') + _spacesPage->selectedSpace(Spaces::SpacesModel::Columns::Name).toString();
};
return FolderMan::instance()->findGoodPathForNewSyncFolder(defaultPath);
}
diff --git a/src/gui/owncloudgui.cpp b/src/gui/owncloudgui.cpp
index ec8212749..b0f9bac98 100644
--- a/src/gui/owncloudgui.cpp
+++ b/src/gui/owncloudgui.cpp
@@ -75,14 +75,12 @@ void setUpInitialSyncFolder(AccountStatePtr accountStatePtr, bool useVfs)
if (drive->parseError().error == QJsonParseError::NoError) {
const auto &drives = drive->drives();
if (!drives.isEmpty()) {
- const QString localDir(accountStatePtr->account()->defaultSyncRoot());
- FolderMan::prepareFolder(localDir);
- Utility::setupFavLink(localDir);
+ const QDir localDir(accountStatePtr->account()->defaultSyncRoot());
+ FileSystem::setFolderMinimumPermissions(localDir.path());
+ Utility::setupFavLink(localDir.path());
for (const auto &d : drives) {
const QString name = GraphApi::Drives::getDriveDisplayName(d);
- const QString mountPoint = localDir + QDir::separator() + GraphApi::Drives::getDriveMountPoint(d);
- FolderMan::prepareFolder(mountPoint);
- const QString folderName = FolderMan::instance()->findGoodPathForNewSyncFolder(mountPoint + QDir::separator() + name);
+ const QString folderName = FolderMan::instance()->findGoodPathForNewSyncFolder(localDir.filePath(name));
addFolder(folderName, {}, QUrl::fromEncoded(d.getRoot().getWebDavUrl().toUtf8()), name);
}
finalize();
diff --git a/src/gui/spaces/spacesbrowser.cpp b/src/gui/spaces/spacesbrowser.cpp
index b8a475dd4..a237bed68 100644
--- a/src/gui/spaces/spacesbrowser.cpp
+++ b/src/gui/spaces/spacesbrowser.cpp
@@ -42,8 +42,6 @@ SpacesBrowser::SpacesBrowser(QWidget *parent)
header->hideSection(static_cast<int>(SpacesModel::Columns::WebDavUrl));
// not used yet
header->hideSection(static_cast<int>(SpacesModel::Columns::WebUrl));
- // not relevant for users
- header->hideSection(static_cast<int>(SpacesModel::Columns::LocalMountPoint));
header->setContextMenuPolicy(Qt::CustomContextMenu);
connect(header, &QHeaderView::customContextMenuRequested, header, [header, this] {
auto menu = new QMenu(this);
diff --git a/src/gui/spaces/spacesmodel.cpp b/src/gui/spaces/spacesmodel.cpp
index 57a777d40..ca7388411 100644
--- a/src/gui/spaces/spacesmodel.cpp
+++ b/src/gui/spaces/spacesmodel.cpp
@@ -45,8 +45,6 @@ QVariant SpacesModel::headerData(int section, Qt::Orientation orientation, int r
return tr("Web Dav URL");
case Columns::Image:
return tr("Image");
- case Columns::LocalMountPoint:
- return tr("Local Mount Point");
case Columns::ColumnCount:
Q_UNREACHABLE();
break;
@@ -97,8 +95,6 @@ QVariant SpacesModel::data(const QModelIndex &index, int role) const
});
return img == special.cend() ? QString() : img->getWebDavUrl();
}
- case Columns::LocalMountPoint:
- return GraphApi::Drives::getDriveMountPoint(item);
case Columns::ColumnCount:
Q_UNREACHABLE();
break;
@@ -122,7 +118,7 @@ QVariant SpacesModel::data(const QModelIndex &index, int role) const
auto job = new OCC::SimpleNetworkJob(_acc, davUrl, path, "GET", {}, {}, nullptr);
connect(job, &OCC::SimpleNetworkJob::finishedSignal, this, [job, id = item.getId(), index, this] {
QPixmap img;
- img.loadFromData(job->reply()->readAll());
+ qDebug() << img.loadFromData(job->reply()->readAll());
img = img.scaled(ImageSizeC, Qt::KeepAspectRatio);
_images[id] = img;
Q_EMIT const_cast<SpacesModel *>(this)->dataChanged(index, index, { Qt::DecorationRole });
diff --git a/src/gui/spaces/spacesmodel.h b/src/gui/spaces/spacesmodel.h
index 290d0a2d6..8f40cd9e7 100644
--- a/src/gui/spaces/spacesmodel.h
+++ b/src/gui/spaces/spacesmodel.h
@@ -31,7 +31,6 @@ public:
Description,
WebUrl,
WebDavUrl,
- LocalMountPoint,
ColumnCount
};