modified algo filling treeview to speed
This commit is contained in:
+11
-4
@@ -31,6 +31,7 @@
|
||||
#include <QShortcut>
|
||||
#include <QCloseEvent>
|
||||
#include <unistd.h>
|
||||
#include <magic.h>
|
||||
|
||||
QT_BEGIN_NAMESPACE
|
||||
namespace Ui { class MainWindow; }
|
||||
@@ -52,7 +53,6 @@ class Downloading
|
||||
std::string path;
|
||||
std::string defaultSavePath;
|
||||
std::string savePath;
|
||||
QString dirPath;
|
||||
int pid = 0;
|
||||
};
|
||||
|
||||
@@ -78,13 +78,13 @@ class MainWindow : public QMainWindow
|
||||
~MainWindow();
|
||||
QProgressDialog *progress;
|
||||
void displayTree();
|
||||
void populateTree();
|
||||
void populateTree(QTreeWidgetItem * parent);
|
||||
void populateList();
|
||||
void listServices();
|
||||
bool validateServer(std::string server);
|
||||
bool isIpAddress(std::string server);
|
||||
QTreeWidgetItem * addTreeRoot(QString name, QString description);
|
||||
QTreeWidgetItem * addTreeChild(QTreeWidgetItem *parent, QString name, QString size);
|
||||
QTreeWidgetItem * addTreeRoot(QString name, QString description, bool isDir);
|
||||
QTreeWidgetItem * addTreeChild(QTreeWidgetItem *parent, QString name, QString size, bool isDir);
|
||||
void scanDir(std::string server, int portN, QTreeWidgetItem *parent = NULL, std::string path = "" );
|
||||
void startDownloading();
|
||||
void loadSettings();
|
||||
@@ -99,6 +99,13 @@ class MainWindow : public QMainWindow
|
||||
QDialog Configuration;
|
||||
Ui::Configuration config;
|
||||
std::vector <QString> serversList;
|
||||
map<char, int> bwUnixIndex {
|
||||
{'B', 0},
|
||||
{'K', 1},
|
||||
{'M', 2},
|
||||
{'G', 3},
|
||||
{'P', 4}
|
||||
};
|
||||
|
||||
private slots:
|
||||
|
||||
|
||||
Reference in New Issue
Block a user