Open sonichy opened 5 years ago
1.Add mounted volumes - HomePage (https://github.com/sonichy/HTYFileManager)
QStorageInfo storage("/"); QString mountPath = storage.rootPath(); foreach (const QStorageInfo &storage, QStorageInfo::mountedVolumes()) { if (storage.isValid() && storage.isReady()) { QString name = storage.name(); QString mountPath = storage.rootPath(); QListWidgetItem *LWI = new QListWidgetItem(QIcon::fromTheme("drive-harddisk"), name); LWI->setData(LOCATION_OF_REAL_PATH, mountPath); ui->listWidget_nav->insertItem(ui->listWidget_nav->count(), LWI); LWI = new QListWidgetItem(QIcon::fromTheme("drive-harddisk"), name + "\n" + BS(storage.bytesFree()) + " / " + BS(storage.bytesTotal())); LWI->setData(LOCATION_OF_REAL_PATH, mountPath); ui->listWidget_partition->insertItem(ui->listWidget_partition->count(), LWI); } }
2.Use qSetMessagePattern("[ %{file}: %{line} ] %{message}"); to show line number when qDebug(). 3.I want to ask: FileManager how to realize drag drop to other application to open file
1.Add mounted volumes - HomePage (https://github.com/sonichy/HTYFileManager)
2.Use qSetMessagePattern("[ %{file}: %{line} ] %{message}"); to show line number when qDebug(). 3.I want to ask: FileManager how to realize drag drop to other application to open file