Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add mounted volumes #149

Open
sonichy opened this issue Jul 29, 2019 · 0 comments
Open

Add mounted volumes #149

sonichy opened this issue Jul 29, 2019 · 0 comments
Labels
enhancement New feature or request

Comments

@sonichy
Copy link

sonichy commented Jul 29, 2019

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);
    }
}

alt
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

@rodlie rodlie added the enhancement New feature or request label Oct 14, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants