dde-smart-dir icon indicating copy to clipboard operation
dde-smart-dir copied to clipboard

Download and Pictures folders not found

Open JunioCalu opened this issue 5 years ago • 0 comments

not yet resolved, a partial patch can be seen below:

diff --git a/SmartDirSettings.cpp b/SmartDirSettings.cpp
index a7b6c55..d0ca494 100644
--- a/SmartDirSettings.cpp
+++ b/SmartDirSettings.cpp
@@ -5,6 +5,7 @@
 #include "SmartDirSettings.h"
 #include <QSettings>
 #include <QDebug>
+#include <QStandardPaths>
 
 SmartDirSettings *SmartDirSettings::instance() {
     static auto *inst = new SmartDirSettings();
@@ -12,7 +13,9 @@ SmartDirSettings *SmartDirSettings::instance() {
 }
 
 SmartDirSettings::SmartDirSettings() {
-    this->_watchedDirPaths << "/home/septemberhx/Downloads" << "/home/septemberhx/Pictures";
+    QString downloadsPath = QStandardPaths::writableLocation(QStandardPaths::DownloadLocation);
+    QString picturesPath = QStandardPaths::writableLocation(QStandardPaths::PicturesLocation);
+    this->_watchedDirPaths << downloadsPath << picturesPath;
     this->setDefaultItemSize();
     this->setDefaultCountPerPage();
     this->setDefaultDirCountPerRow();
diff --git a/widgets/SpecialLabel.cpp b/widgets/SpecialLabel.cpp
index c1b5166..8cdb10c 100644
--- a/widgets/SpecialLabel.cpp
+++ b/widgets/SpecialLabel.cpp
@@ -6,6 +6,7 @@
 #include <QPaintEvent>
 #include <QPainter>
 #include <QFontMetrics>
+#include <QPainterPath>
 
 SpecialLabel::SpecialLabel(QWidget *parent,  QColor bgC, QColor fC)
     : QLabel(parent)
diff --git a/widgets/widgets.pro.user b/widgets/widgets.pro.user
index bff49ac..1d50272 100644
--- a/widgets/widgets.pro.user
+++ b/widgets/widgets.pro.user
@@ -69,7 +69,7 @@
    <value type="int" key="ProjectExplorer.Target.ActiveDeployConfiguration">0</value>
    <value type="int" key="ProjectExplorer.Target.ActiveRunConfiguration">0</value>
    <valuemap type="QVariantMap" key="ProjectExplorer.Target.BuildConfiguration.0">
-    <value type="QString" key="ProjectExplorer.BuildConfiguration.BuildDirectory">/home/septemberhx/Workspace/git/dde-smart-dir/build-widgets-default-Debug</value>
+    <value type="QString" key="ProjectExplorer.BuildConfiguration.BuildDirectory">/$HOME/Workspace/git/dde-smart-dir/build-widgets-default-Debug</value>
     <valuemap type="QVariantMap" key="ProjectExplorer.BuildConfiguration.BuildStepList.0">
      <valuemap type="QVariantMap" key="ProjectExplorer.BuildStepList.Step.0">
       <value type="bool" key="ProjectExplorer.BuildStep.Enabled">true</value>
@@ -125,7 +125,7 @@
     <value type="bool" key="Qt4ProjectManager.Qt4BuildConfiguration.UseShadowBuild">true</value>
    </valuemap>
    <valuemap type="QVariantMap" key="ProjectExplorer.Target.BuildConfiguration.1">
-    <value type="QString" key="ProjectExplorer.BuildConfiguration.BuildDirectory">/home/septemberhx/Workspace/git/dde-smart-dir/build-widgets-default-Release</value>
+    <value type="QString" key="ProjectExplorer.BuildConfiguration.BuildDirectory">/$HOME/Workspace/git/dde-smart-dir/build-widgets-default-Release</value>
     <valuemap type="QVariantMap" key="ProjectExplorer.BuildConfiguration.BuildStepList.0">
      <valuemap type="QVariantMap" key="ProjectExplorer.BuildStepList.Step.0">
       <value type="bool" key="ProjectExplorer.BuildStep.Enabled">true</value>
@@ -181,7 +181,7 @@
     <value type="bool" key="Qt4ProjectManager.Qt4BuildConfiguration.UseShadowBuild">true</value>
    </valuemap>
    <valuemap type="QVariantMap" key="ProjectExplorer.Target.BuildConfiguration.2">
-    <value type="QString" key="ProjectExplorer.BuildConfiguration.BuildDirectory">/home/septemberhx/Workspace/git/dde-smart-dir/build-widgets-default-Profile</value>
+    <value type="QString" key="ProjectExplorer.BuildConfiguration.BuildDirectory">/$HOME/Workspace/git/dde-smart-dir/build-widgets-default-Profile</value>
     <valuemap type="QVariantMap" key="ProjectExplorer.BuildConfiguration.BuildStepList.0">
      <valuemap type="QVariantMap" key="ProjectExplorer.BuildStepList.Step.0">
       <value type="bool" key="ProjectExplorer.BuildStep.Enabled">true</value>
@@ -295,7 +295,7 @@
     <valuelist type="QVariantList" key="PE.EnvironmentAspect.Changes"/>
     <value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">widgets</value>
     <value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value>
-    <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">Qt4ProjectManager.Qt4RunConfiguration:/home/septemberhx/Workspace/git/dde-smart-dir/widgets/widgets.pro</value>
+    <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">Qt4ProjectManager.Qt4RunConfiguration:/$HOME/Workspace/git/dde-smart-dir/widgets/widgets.pro</value>
     <value type="QString" key="Qt4ProjectManager.Qt4RunConfiguration.ProFile">widgets.pro</value>
     <value type="QString" key="RunConfiguration.Arguments"></value>
     <value type="uint" key="RunConfiguration.QmlDebugServerPort">3768</value>
@@ -306,7 +306,7 @@
     <value type="bool" key="RunConfiguration.UseQmlDebugger">false</value>
     <value type="bool" key="RunConfiguration.UseQmlDebuggerAuto">true</value>
     <value type="QString" key="RunConfiguration.WorkingDirectory"></value>
-    <value type="QString" key="RunConfiguration.WorkingDirectory.default">/home/septemberhx/Workspace/git/dde-smart-dir/build-widgets-default-Debug</value>
+    <value type="QString" key="RunConfiguration.WorkingDirectory.default">/$HOME/Workspace/git/dde-smart-dir/build-widgets-default-Debug</value>
    </valuemap>
    <value type="int" key="ProjectExplorer.Target.RunConfigurationCount">1</value>
   </valuemap>

log message:

main.go:75: open failed: stat /home/septemberhx/Downloads: no such file or directory main.go:75: open failed: stat /home/septemberhx/Pictures: no such file or directory

PKGBUILD:

PKGBUILD.txt fix.patch.txt

JunioCalu avatar Jun 21 '20 18:06 JunioCalu