+ long id, appr = -1;
+
+ QStringList all_files;
+
+ // get all files from the same dir where use file is (should be) situated
+ QDir d( QFileInfo( fname ).dir() );
+ if ( d.exists() ) {
+ d.setFilter( QDir::Files | QDir::Hidden | QDir::NoSymLinks );
+ QStringList l = d.entryList();
+ foreach( QString ll, l )
+ all_files << d.absoluteFilePath( ll );
+ }
+ // backward compatibility: check also user's home directory (if it differs from above one)
+ QDir home = QDir::home();
+ if ( home.exists() && d.canonicalPath() != home.canonicalPath() ) {
+ home.setFilter( QDir::Files | QDir::Hidden | QDir::NoSymLinks );
+ QStringList l = home.entryList();
+ foreach( QString ll, l )
+ all_files << home.absoluteFilePath( ll );
+ }
+
+ for( QStringList::const_iterator anIt = all_files.begin(), aLast = all_files.end(); anIt!=aLast; anIt++ )