I'd like to detect when a SDCARD or USB is inserted in my QT based linux embedded System. I made the following, but I think something is missing:
FSwatcher = new QFileSystemWatcher(this);
FSwatcher->addPath("/run/media");
connect(FSwatcher, SIGNAL(directoryChanged(QString)), this,SLOT(showModifiedDirectory(QString)));
}
void ts400::showModifiedDirectory(QString)
{
qDebug() << "Detected++++++++++++++++++++++++++++++++";
}
I don't understand why the connector doens't function (no call to my Slot). Is there someone who can give some instruction about? Thanks