lokalize
filesearchtab.cpp
Go to the documentation of this file.
199 SearchJob::SearchJob(const QStringList& f, const SearchParams& sp, const QVector<Rule>& r, int sn, QObject* parent)
243 r.sourcePositions<<StartLen(searchParams.sourcePattern.pos(), searchParams.sourcePattern.matchedLength());
245 r.targetPositions<<StartLen(searchParams.targetPattern.pos(), searchParams.targetPattern.matchedLength());
297 MassReplaceJob::MassReplaceJob(const SearchResults& srs, int pos, const QRegExp& s, const QString& r, QObject* parent)
357 beginInsertRows(QModelIndex(), m_searchResults.size(), m_searchResults.size()+results.size()-1);
405 const QVector<StartLen>& occurences=item.column()==FileSearchModel::Source?sr.sourcePositions:sr.targetPositions;
414 QString escaped=convertToHtml(result, item.column()==FileSearchModel::Target && !sr.isApproved);
480 connect(m_model,SIGNAL(dataChanged(QModelIndex,QModelIndex)),view->itemDelegate(),SLOT(reset()));
481 //connect(m_model,SIGNAL(rowsMoved(QModelIndex,int,int,QModelIndex,int)),view->itemDelegate(),SLOT(reset()));
524 static const int maxInitialWidths[]={QApplication::desktop()->availableGeometry().width()/3,QApplication::desktop()->availableGeometry().width()/3};
540 KActionCategory* srf=new KActionCategory(i18nc("@title actions category","Search and replace in files"), ac);
545 srf->addAction( QLatin1String("showfilelist_action"), m_searchFileListView->toggleViewAction() );
549 srf->addAction( QLatin1String("showmassreplace_action"), m_massReplaceView->toggleViewAction() );
550 connect(m_massReplaceView, SIGNAL(previewRequested(QRegExp,QString)), m_model, SLOT(setReplacePreview(QRegExp ,QString)));
551 connect(m_massReplaceView, SIGNAL(replaceRequested(QRegExp,QString)), this, SLOT(massReplace(QRegExp,QString)));
560 connect(m_qaView->toggleViewAction(), SIGNAL(toggled(bool)), this, SLOT(performSearch()), Qt::QueuedConnection);
564 view->header()->restoreState(QByteArray::fromBase64( cg.readEntry("FileSearchResultsHeaderState", QByteArray()) ));
573 cg.writeEntry("FileSearchResultsHeaderState",ui_fileSearchOptions->treeView->header()->saveState().toBase64());
628 QObject::connect(job,SIGNAL(done(ThreadWeaver::Job*)),this,SLOT(searchJobDone(ThreadWeaver::Job*)));
658 QObject::connect(job,SIGNAL(done(ThreadWeaver::Job*)),this,SLOT(replaceJobDone(ThreadWeaver::Job*)));
667 QApplication::clipboard()->setText( view->currentIndex().sibling(view->currentIndex().row(),column).data().toString());
798 statusBarItems.insert(1,i18nc("@info:status message entries","Total: %1", m_model->rowCount()));
805 ui_fileSearchOptions->treeView->scrollTo(m_model->index(j->globalPos+j->searchResults.count(), 0));
902 QDBusConnection::sessionBus().registerObject("/ThisIsWhatYouWant/FileSearch/" + QString::number(m_dbusId), this);
Definition: filesearchtab.h:157
void massReplace(const QRegExp &what, const QString &with)
Definition: filesearchtab.cpp:643
void setShortcutContext(Qt::ShortcutContext context)
SearchResult searchResult(const QModelIndex &item) const
Definition: filesearchtab.h:179
void setAlternatingRowColors(bool enable)
const QMimeData * mimeData() const
#define BATCH_SIZE
bool isEmpty() const
void append(const T &value)
void addAction(QAction *action)
Definition: filesearchtab.h:155
bool restoreState(const QByteArray &state)
void setMinimumWidth(int minw)
const_iterator constEnd() const
const T & at(int i) const
QVariant data(const QModelIndex &item, int role=Qt::DisplayRole) const
Definition: filesearchtab.cpp:369
bool registerObject(const QString &path, QObject *object, QFlags< QDBusConnection::RegisterOption > options)
bool isVisible() const
QString filePath(const QString &fileName) const
void setAlignment(QFlags< Qt::AlignmentFlag >)
void setUniformRowHeights(bool uniform)
QDBusConnection sessionBus()
T & first()
Definition: filesearchtab.h:218
Definition: filesearchtab.h:160
void setReplacePreview(const QRegExp &, const QString &)
Definition: filesearchtab.cpp:434
int size() const
int width() const
void beginResetModel()
QList< Key > keys() const
void clear()
QStringList stringList() const
int elapsed() const
void setColumnWidth(int column, int width)
QString number(int n, int base)
void append(const T &value)
Definition: filesearchtab.h:192
QString & insert(int position, QChar ch)
virtual QVariant data(const QModelIndex &index, int role) const
void dataChanged(const QModelIndex &topLeft, const QModelIndex &bottomRight)
void addFilesFast(const QStringList &files)
Definition: filesearchtab.cpp:125
QClipboard * clipboard()
void endInsertRows()
void replaceRequested(const QRegExp &, const QString &)
Definition: state.h:42
virtual QModelIndex index(int row, int column, const QModelIndex &parent) const
bool isEmpty() const
int rowCount(const QModelIndex &parent=QModelIndex()) const
Definition: filesearchtab.h:176
bool isEmpty() const
int removeAll(const T &value)
void setItemDelegate(QAbstractItemDelegate *delegate)
int row() const
QAbstractItemDelegate * itemDelegate() const
Q_SCRIPTABLE void addFilesToSearch(const QStringList &)
Definition: filesearchtab.cpp:763
QFuture< T > run(Function function,...)
QVector< T > mid(int pos, int length) const
void hide()
QFuture< void > map(Sequence &sequence, MapFunction function)
remember to connect appropriate signals to reset slot for delegate to have actual cache ...
Definition: fastsizehintitemdelegate.h:42
void squeeze()
void scrollTo(const QString &file=QString())
Definition: filesearchtab.cpp:142
Definition: filesearchtab.h:137
void setContextMenuPolicy(Qt::ContextMenuPolicy policy)
void setShortcut(const QKeySequence &shortcut)
virtual void scrollTo(const QModelIndex &index, ScrollHint hint)
void beginInsertRows(const QModelIndex &parent, int first, int last)
void setWidget(QWidget *widget)
int findMatchingRule(const QVector< Rule > &rules, const QString &source, const QString &target, QVector< StartLen > &positions)
Definition: qaview.cpp:100
QString & replace(int position, int n, QChar after)
data structure used to pass info about inline elements a XLIFF tag is represented by a TAGRANGE_IMAGE...
Definition: catalogstring.h:128
const T & at(int i) const
Definition: filesearchtab.h:147
const_iterator constBegin() const
int width() const
QAction * toggleViewAction() const
StatusBarProxy statusBarItems
Definition: lokalizesubwindowbase.h:63
void addFiles(const QStringList &files)
Definition: filesearchtab.cpp:106
QDesktopWidget * desktop()
QList< QUrl > urls() const
QByteArray fromBase64(const QByteArray &base64)
void setHeaderHidden(bool hide)
void insert(int i, const T &value)
QString convertToHtml(QString str, bool italics)
Definition: fastsizehintitemdelegate.cpp:119
bool isEmpty() const
QModelIndex sibling(int row, int column) const
QStringList entryList(QFlags< QDir::Filter > filters, QFlags< QDir::SortFlag > sort) const
void scrollToTop()
virtual void setModel(QAbstractItemModel *model)
Definition: qaview.h:36
QWidget(QWidget *parent, QFlags< Qt::WindowType > f)
int count(const T &value) const
Definition: filesearchtab.h:154
int column() const
int length() const
void previewRequested(const QRegExp &, const QString &)
void start()
This class represents a catalog It uses CatalogStorage interface to work with catalogs in different f...
Definition: catalog.h:74
const QRect availableGeometry(int screen) const
int indexOf(const QRegExp &rx, int from) const
void setText(const QString &text, Mode mode)
QHeaderView * header() const
void show()
void fileOpenRequested(const KUrl &url, DocPosition docPos, int selection)
QModelIndex currentIndex() const
void setRootIsDecorated(bool show)
void endResetModel()
bool connect(const QObject *sender, const char *signal, const QObject *receiver, const char *method, Qt::ConnectionType type)
int size() const
QVariant headerData(int section, Qt::Orientation orientation, int role=Qt::DisplayRole) const
Definition: filesearchtab.cpp:340
void appendSearchResults(const SearchResults &)
Definition: filesearchtab.cpp:355
void setStringList(const QStringList &strings)
This file is part of the KDE documentation.
Documentation copyright © 1996-2020 The KDE developers.
Generated on Mon Jun 22 2020 13:40:07 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006
Documentation copyright © 1996-2020 The KDE developers.
Generated on Mon Jun 22 2020 13:40:07 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006
KDE's Doxygen guidelines are available online.