this, SLOT(updateActivationState()));
m_urlNavigator = new UrlNavigator(url, this);
+ m_urlNavigator->setShowHiddenFiles(showHiddenFiles);
connect(m_urlNavigator, SIGNAL(urlChanged(const KUrl&)),
this, SLOT(loadDirectory(const KUrl&)));
connect(m_urlNavigator, SIGNAL(urlsDropped(const KUrl::List&, const KUrl&)),
props.save();
m_dirLister->setShowingDotFiles(show);
+ m_urlNavigator->setShowHiddenFiles(show);
emit showHiddenFilesChanged();
QWidget* parent) :
QWidget(parent),
m_active(true),
+ m_showHiddenFiles(false),
m_historyIndex(0),
m_layout(0),
m_protocols(0),
}
}
+void UrlNavigator::setShowHiddenFiles( bool show )
+{
+ m_showHiddenFiles = show;
+}
+
void UrlNavigator::dropUrls(const KUrl::List& urls,
const KUrl& destination)
{
*/
bool isActive() const { return m_active; }
+ /**
+ * Sets whether or not to show hidden files in lists
+ */
+ void setShowHiddenFiles( bool show );
+
+ /**
+ * Returns true if the URL navigator is set to show hidden files
+ */
+ bool showHiddenFiles() { return m_showHiddenFiles; }
+
/**
* Handles the dropping of the URLs \a urls to the given
* destination \a destination and emits the signal urlsDropped.
private:
bool m_active;
+ bool m_showHiddenFiles;
int m_historyIndex;
QHBoxLayout* m_layout;
}
const KUrl& url = urlNavigator()->url(m_index);
- m_listJob = KIO::listDir(url, false, false);
+ m_listJob = KIO::listDir(url, false, urlNavigator()->showHiddenFiles());
m_subdirs.clear(); // just to be ++safe
connect(m_listJob, SIGNAL(entries(KIO::Job*, const KIO::UDSEntryList &)),
KIO::UDSEntryList::const_iterator it = entries.constBegin();
KIO::UDSEntryList::const_iterator itEnd = entries.constEnd();
+
+ bool showHidden = urlNavigator()->showHiddenFiles();
while (it != itEnd) {
QString name;
//bool isDir = false;
*/
if (entry.isDir()) {
- m_subdirs.append(entry.stringValue(KIO::UDS_NAME));
+ QString dir = entry.stringValue(KIO::UDS_NAME);
+
+ if (!showHidden || (dir != "." && dir != "..")) {
+ m_subdirs.append(entry.stringValue(KIO::UDS_NAME));
+ }
}
++it;