Merge remote-tracking branch 'origin/KDE/4.10' into KDE/4.11

This commit is contained in:
Frank Reininghaus 2013-07-25 22:29:42 +02:00
commit 29b279db0a
5 changed files with 36 additions and 11 deletions

View file

@ -18,6 +18,7 @@
#include <qdir.h>
#include <qstringlist.h>
#include <qset.h>
#include <kdebug.h>
#include <kurl.h>
@ -216,6 +217,21 @@ void ScanDir::update()
}
}
bool ScanDir::isForbiddenDir(QString& d)
{
static QSet<QString>* s = 0;
if (!s) {
s = new QSet<QString>;
// directories without real files on Linux
// TODO: should be OS specific
s->insert("/proc");
s->insert("/dev");
s->insert("/sys");
}
return (s->contains(d));
}
int ScanDir::scan(ScanItem* si, ScanItemList& list, int data)
{
clear();
@ -223,6 +239,12 @@ int ScanDir::scan(ScanItem* si, ScanItemList& list, int data)
_fileSize = 0;
_dirty = true;
if (isForbiddenDir(si->absPath)) {
if (_parent)
_parent->subScanFinished();
return 0;
}
KUrl u;
u.setPath(si->absPath);
if (!KAuthorized::authorizeUrlAction("list", KUrl(), u)) {
@ -257,10 +279,12 @@ int ScanDir::scan(ScanItem* si, ScanItemList& list, int data)
_dirs.reserve(dirList.count());
QStringList::ConstIterator it;
for (it = dirList.constBegin(); it != dirList.constEnd(); ++it ) {
for (it = dirList.constBegin(); it != dirList.constEnd(); ++it ) {
_dirs.append( ScanDir(*it, _manager, this, data) );
list.append( new ScanItem( si->absPath + '/' + (*it),
&(_dirs.last()) ));
QString newpath = si->absPath;
if (!newpath.endsWith(QChar('/'))) newpath.append("/");
newpath.append(*it);
list.append( new ScanItem( newpath, &(_dirs.last()) ));
}
_dirCount += _dirs.count();
}

View file

@ -59,12 +59,12 @@ class ScanListener
{
public:
virtual ~ScanListener(){}
virtual void scanStarted(ScanDir*) {};
virtual void sizeChanged(ScanDir*) {};
virtual void scanFinished(ScanDir*) {};
virtual void scanStarted(ScanDir*) {}
virtual void sizeChanged(ScanDir*) {}
virtual void scanFinished(ScanDir*) {}
// destroyed events are not delivered to listeners of ScanManager
virtual void destroyed(ScanDir*) {};
virtual void destroyed(ScanFile*) {};
virtual void destroyed(ScanDir*) {}
virtual void destroyed(ScanFile*) {}
};
@ -206,6 +206,7 @@ class ScanDir
private:
void update();
bool isForbiddenDir(QString&);
/* this propagates file count and size to upper dirs */
void subScanFinished();

View file

@ -44,7 +44,7 @@ Name[lv]=Attēlu galerija
Name[mr]=ि
Name[nb]=Bildegalleri
Name[nds]=Bildgalerie
Name[nl]=Afbeeldingsgalerij
Name[nl]=Galerij van afbeeldingen
Name[nn]=Biletgalleri
Name[pa]=ਿ
Name[pl]=Galeria obrazów

View file

@ -68,7 +68,7 @@ Name[ms]=Plugin Arahan Shell
Name[nb]=Programtillegg for skallkommandoer
Name[nds]=Moduul för Konsoolbefehlen
Name[ne]=
Name[nl]=Shellcommando-plugin
Name[nl]=Shellcommando-plug-in
Name[nn]=Programtillegg for skalkommandoar
Name[or]=Shell ି
Name[pa]=

View file

@ -59,7 +59,7 @@ Name[ms]=Pelayaran Bertab
Name[nb]=Nettleser med faner
Name[nds]=Nettkieken mit Paneels
Name[ne]= ि ि
Name[nl]=Browser met tabbladen
Name[nl]=Browsen met tabbladen
Name[nn]=Nettlesar med faner
Name[or]=Tabbed ି
Name[pa]=