Commit 18b4adf6 authored by con's avatar con
Browse files

Remove unused files

parent 1074aca8
/**************************************************************************
**
** This file is part of Qt Creator
**
** Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
**
** Contact: Nokia Corporation (qt-info@nokia.com)
**
** Commercial Usage
**
** Licensees holding valid Qt Commercial licenses may use this file in
** accordance with the Qt Commercial License Agreement provided with the
** Software or, alternatively, in accordance with the terms contained in
** a written agreement between you and Nokia.
**
** GNU Lesser General Public License Usage
**
** Alternatively, this file may be used under the terms of the GNU Lesser
** General Public License version 2.1 as published by the Free Software
** Foundation and appearing in the file LICENSE.LGPL included in the
** packaging of this file. Please review the following information to
** ensure the GNU Lesser General Public License version 2.1 requirements
** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
**
** If you are unsure which license is appropriate for your use, please
** contact the sales department at http://qt.nokia.com/contact.
**
**************************************************************************/
#include "directoryparser.h"
#include "quickopenplugin.h"
using namespace QuickOpen::Internal;
DirectoryParser::DirectoryParser(QObject *parent)
: QThread(parent)
{
}
DirectoryParser::~DirectoryParser()
{
if (isRunning())
terminate();
}
void DirectoryParser::parse(Filter filter)
{
m_dirs = filter.directories();
m_filters = filter.acceptedFileExtensions().split(';');
m_blackList.clear();
foreach (QString s, filter.skipDirectories()) {
if (!s.trimmed().isEmpty() && !m_blackList.contains(s))
m_blackList.insert(s);
}
if (!isRunning())
start(QThread::NormalPriority);
}
void DirectoryParser::setDirectoryNameBlackList(const QStringList &lst)
{
m_blackList.clear();
foreach (QString s, lst) {
if (!m_blackList.contains(s))
m_blackList.insert(s);
}
}
QSet<QString> DirectoryParser::files() const
{
return m_files;
}
void DirectoryParser::run()
{
m_files.clear();
m_runFiles.clear();
foreach (QString s, m_dirs) {
if (s.isEmpty())
continue;
QDir dir(s);
if (dir.exists()) {
m_runFilters = m_filters;
m_runBlackList = m_blackList;
collectFiles(dir);
}
}
m_files = m_runFiles;
emit directoriesParsed();
}
void DirectoryParser::collectFiles(const QDir &dir)
{
QString dirName = dir.absolutePath() + QLatin1String("/");
foreach (QString f, dir.entryList(m_runFilters, QDir::Files)) {
m_runFiles.insert(dirName + f);
}
foreach (QString d, dir.entryList(QDir::Dirs | QDir::NoDotAndDotDot)) {
if (!m_runBlackList.contains(d))
collectFiles(dir.absolutePath() + QDir::separator() + d);
}
}
/**************************************************************************
**
** This file is part of Qt Creator
**
** Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
**
** Contact: Nokia Corporation (qt-info@nokia.com)
**
** Commercial Usage
**
** Licensees holding valid Qt Commercial licenses may use this file in
** accordance with the Qt Commercial License Agreement provided with the
** Software or, alternatively, in accordance with the terms contained in
** a written agreement between you and Nokia.
**
** GNU Lesser General Public License Usage
**
** Alternatively, this file may be used under the terms of the GNU Lesser
** General Public License version 2.1 as published by the Free Software
** Foundation and appearing in the file LICENSE.LGPL included in the
** packaging of this file. Please review the following information to
** ensure the GNU Lesser General Public License version 2.1 requirements
** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
**
** If you are unsure which license is appropriate for your use, please
** contact the sales department at http://qt.nokia.com/contact.
**
**************************************************************************/
#ifndef DIRECTORYPARSER_H
#define DIRECTORYPARSER_H
#include <QtCore/QThread>
#include <QtCore/QDir>
#include <QtCore/QSet>
namespace QuickOpen {
namespace Internal {
class Filter;
class DirectoryParser : public QThread
{
Q_OBJECT
public:
DirectoryParser(QObject *parent);
~DirectoryParser();
void parse(Filter filter);
void setDirectoryNameBlackList(const QStringList &lst);
QSet<QString> files() const;
signals:
void directoriesParsed();
private:
void run();
void collectFiles(const QDir &dir);
QStringList m_dirs;
QSet<QString> m_files;
QSet<QString> m_runFiles;
QStringList m_filters;
QStringList m_runFilters;
QSet<QString> m_blackList;
QSet<QString> m_runBlackList;
};
} // namespace Internal
} // namespace QuickOpen
#endif // DIRECTORYPARSER_H
<ui version="4.0" >
<class>QuickOpen::Internal::SettingsDialog</class>
<widget class="QWidget" name="QuickOpen::Internal::SettingsDialog" >
<property name="geometry" >
<rect>
<x>0</x>
<y>0</y>
<width>460</width>
<height>353</height>
</rect>
</property>
<property name="windowTitle" >
<string>Configure Filters</string>
</property>
<layout class="QGridLayout" >
<item row="0" column="0" >
<widget class="QListWidget" name="filterList" >
<property name="font" >
<font/>
</property>
</widget>
</item>
<item row="0" column="1" >
<layout class="QVBoxLayout" >
<item>
<widget class="QPushButton" name="addButton" >
<property name="enabled" >
<bool>false</bool>
</property>
<property name="text" >
<string>Add</string>
</property>
</widget>
</item>
<item>
<widget class="QPushButton" name="removeButton" >
<property name="enabled" >
<bool>false</bool>
</property>
<property name="text" >
<string>Remove</string>
</property>
</widget>
</item>
<item>
<widget class="QPushButton" name="editButton" >
<property name="enabled" >
<bool>false</bool>
</property>
<property name="text" >
<string>Edit...</string>
</property>
</widget>
</item>
<item>
<spacer>
<property name="orientation" >
<enum>Qt::Vertical</enum>
</property>
<property name="sizeHint" >
<size>
<width>20</width>
<height>40</height>
</size>
</property>
</spacer>
</item>
</layout>
</item>
<item row="1" column="0" colspan="2" >
<layout class="QHBoxLayout" >
<item>
<widget class="QLabel" name="label" >
<property name="text" >
<string>Refresh Interval:</string>
</property>
</widget>
</item>
<item>
<widget class="QSpinBox" name="refreshInterval" >
<property name="frame" >
<bool>true</bool>
</property>
<property name="buttonSymbols" >
<enum>QAbstractSpinBox::PlusMinus</enum>
</property>
<property name="suffix" >
<string> min</string>
</property>
<property name="maximum" >
<number>320</number>
</property>
<property name="singleStep" >
<number>5</number>
</property>
<property name="value" >
<number>60</number>
</property>
</widget>
</item>
<item>
<widget class="QToolButton" name="refreshButton" >
<property name="font" >
<font/>
</property>
<property name="text" >
<string>Refresh now!</string>
</property>
<property name="toolButtonStyle" >
<enum>Qt::ToolButtonTextBesideIcon</enum>
</property>
</widget>
</item>
<item>
<spacer>
<property name="orientation" >
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" >
<size>
<width>40</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
</layout>
</item>
</layout>
</widget>
<resources/>
<connections/>
</ui>
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment