m_startedFromDir = url();
}
- if (isVisible() && DolphinSearchInformation::instance().isIndexingEnabled()) {
+ if (isVisible() && DolphinSearchInformation::instance().isIndexingEnabled()) {
const Nepomuk::Query::FileQuery query(m_unfacetedRestQuery && m_facetWidget->queryTerm());
if (query.toSearchUrl() == url()) {
// The new URL has been triggered by the SearchPanel itself in
/**
* Starting a drag&drop operation should not clear the selection, see
- *
+ *
* https://bugs.kde.org/show_bug.cgi?id=158649
*/
Q_DECLARE_METATYPE(KFileItemList)
void DolphinViewTest_AllViewModes::testSelection() {
- TestDir dir;
+ TestDir dir;
const int totalItems = 50;
for (int i = 0; i < totalItems; i++) {
dir.createFile(QString("%1").arg(i));
virtual ~DolphinCategoryDrawer();
bool allCategorySelected(const QString &category) const;
-
+
bool someCategorySelected(const QString &category) const;
virtual void drawCategory(const QModelIndex &index, int sortRole,
* Free Software Foundation, Inc., *
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA *
***************************************************************************/
-
+
/*
* This code is largely based on the kremoteencodingplugin
* Copyright (c) 2003 Thiago Macieira <thiago.macieira@kdemail.net>
* Distributed under the same terms.
*/
-
+
#include "dolphinremoteencoding.h"
#include "dolphinviewactionhandler.h"
:QObject(parent),
m_actionHandler(actionHandler),
m_loaded(false),
- m_idDefault(0)
+ m_idDefault(0)
{
m_menu = new KActionMenu(KIcon("character-set"), i18n("Select Remote Charset"), this);
m_actionHandler->actionCollection()->addAction("change_remote_encoding", m_menu);
// everything whose type is T_FILESYSTEM except for local files
if (!m_currentURL.isLocalFile() &&
KProtocolManager::outputType(m_currentURL) == KProtocolInfo::T_FILESYSTEM) {
-
+
m_menu->setEnabled(true);
loadSettings();
} else {
KMenu* menu = m_menu->menu();
menu->clear();
-
+
for (int i = 0; i < m_encodingDescriptions.size();i++) {
QAction* action = new QAction(m_encodingDescriptions.at(i), this);
action->setCheckable(true);
menu->addAction(i18n("Reload"), this, SLOT(slotReload()), 0);
menu->addAction(i18n("Default"), this, SLOT(slotDefault()), 0)->setCheckable(true);
m_idDefault = m_encodingDescriptions.size() + 2;
-
+
connect(menu, SIGNAL(triggered(QAction*)), this, SLOT(slotItemSelected(QAction*)));
}
if (!m_loaded) {
loadSettings();
}
-
+
// uncheck everything
for (int i = 0; i < m_menu->menu()->actions().count(); i++) {
m_menu->menu()->actions().at(i)->setChecked(false);
}
-
+
QString charset = KIO::SlaveConfig::self()->configData(m_currentURL.protocol(),
m_currentURL.host(), DATA_KEY);
break;
}
}
-
+
kDebug() << "URL=" << m_currentURL << " charset=" << charset;
if (!isFound) {
} else {
m_menu->menu()->actions().at(m_idDefault)->setChecked(true);
}
-
+
}
void DolphinRemoteEncoding::slotAboutToShow()
{
if (action) {
int id = action->data().toInt();
-
+
KConfig config(("kio_" + m_currentURL.protocol() + "rc").toLatin1());
QString host = m_currentURL.host();
if (m_menu->menu()->actions().at(id)->isChecked()) {
void slotItemSelected(QAction* action);
void slotReload();
void slotDefault();
-
+
private Q_SLOTS:
void slotAboutToShow();
-
+
private:
void updateView();
void loadSettings();
QList<QAction*> contextMenuActions(const KFileItemList& items) const;
QList<QAction*> contextMenuActions(const QString& directory) const;
-
+
signals:
/**
* Is emitted if an information message with the content \a msg
* should be shown.
*/
void operationCompletedMessage(const QString& msg);
-
+
private slots:
/**
* Invokes verifyDirectory() with a small delay. If delayedDirectoryVerification()
* delayedDirectoryVerification() it and assures that the verification of
* the directory is done silently without information messages.
*/
- void silentDirectoryVerification();
+ void silentDirectoryVerification();
void verifyDirectory();
* and applys the item states.
*/
void slotThreadFinished();
-
+
private:
struct ItemState
{
bool m_versionedDirectory;
bool m_silentUpdate; // if true, no messages will be send during the update
// of version states
-
+
QAbstractItemView* m_view;
KDirLister* m_dirLister;
DolphinModel* m_dolphinModel;
-
+
QTimer* m_dirVerificationTimer;
KVersionControlPlugin* m_plugin;
KFilePreviewGenerator* m_previewGenerator;
SelectionManager* m_selectionManager;
DolphinViewAutoScroller* m_autoScroller;
- DolphinFileItemDelegate* m_fileItemDelegate;
+ DolphinFileItemDelegate* m_fileItemDelegate;
VersionControlObserver* m_versionControlObserver;
FolderExpander* m_folderExpander;
};
public:
static int minimumLevel();
static int maximumLevel();
-
+
/**
* Helper method for the view implementation to get
* the icon size for the zoom level \a level that
* ZoomLevelInfo::maximumLevel().
*/
static int iconSizeForZoomLevel(int level);
-
+
/**
* Helper method for the view implementation to get
* the zoom level for the icon size \a size that