mirror of
https://invent.kde.org/system/dolphin
synced 2024-11-05 18:47:12 +00:00
Merge remote-tracking branch 'origin/KDE/4.10' into KDE/4.11
This commit is contained in:
commit
29b279db0a
5 changed files with 36 additions and 11 deletions
|
@ -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();
|
||||
}
|
||||
|
|
|
@ -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();
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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]=ਸੈੱਲ ਕਮਾਂਡ ਪਲੱਗਇਨ
|
||||
|
|
|
@ -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]=ਟੈਬ ਝਲਕ
|
||||
|
|
Loading…
Reference in a new issue