qt - Check if directory is empty -


i'm trying check if directory empty.

mainwindow::mainwindow(qwidget *parent) :     qmainwindow(parent),     ui(new ui::mainwindow) {     ui->setupui(this);     qdir dir("/home/highlander/desktop/dir");     if(dir.count() == 0)     {         qmessagebox::information(this,"directory empty","empty!!!");     } } 

whats right way check it, excluding . , ..?

well, got way :)

if(qdir("/home/highlander/desktop/dir").entryinfolist(qdir::nodotanddotdot|qdir::allentries).count() == 0) {     qmessagebox::information(this,"directory empty","empty!!!"); } 

Comments

Popular posts from this blog

linux - Does gcc have any options to add version info in ELF binary file? -

android - send complex objects as post php java -

charts - What graph/dashboard product is facebook using in Dashboard: PUE & WUE -