Commit be29c414 authored by Friedrich W. H. Kossebau's avatar Friedrich W. H. Kossebau
Browse files

clang-tidy run: use-modernize-using (& manual porting)

parent 2b3aedad
......@@ -184,9 +184,9 @@ KDevelop::StandardDocumentationView::~StandardDocumentationView() = default;
void StandardDocumentationView::search ( const QString& text, DocumentationFindWidget::FindOptions options )
{
#ifdef USE_QTWEBKIT
typedef QWebPage WebkitThing;
using WebkitThing = QWebPage;
#else
typedef QWebEnginePage WebkitThing;
using WebkitThing = QWebEnginePage;
#endif
WebkitThing::FindFlags ff = {};
if(options & DocumentationFindWidget::Previous)
......@@ -201,9 +201,9 @@ void StandardDocumentationView::search ( const QString& text, DocumentationFindW
void StandardDocumentationView::searchIncremental(const QString& text, DocumentationFindWidget::FindOptions options)
{
#ifdef USE_QTWEBKIT
typedef QWebPage WebkitThing;
using WebkitThing = QWebPage;
#else
typedef QWebEnginePage WebkitThing;
using WebkitThing = QWebEnginePage;
#endif
WebkitThing::FindFlags findFlags;
......@@ -334,9 +334,9 @@ QMenu* StandardDocumentationView::createStandardContextMenu()
{
auto menu = new QMenu(this);
#ifdef USE_QTWEBKIT
typedef QWebPage WebkitThing;
using WebkitThing = QWebPage;
#else
typedef QWebEnginePage WebkitThing;
using WebkitThing = QWebEnginePage;
#endif
auto copyAction = d->m_view->pageAction(WebkitThing::Copy);
if (copyAction) {
......
......@@ -36,7 +36,7 @@ class KDEVPLATFORMINTERFACES_EXPORT IAssistantAction : public QObject, public KS
public:
IAssistantAction();
typedef QExplicitlySharedDataPointer<IAssistantAction> Ptr;
using Ptr = QExplicitlySharedDataPointer<IAssistantAction>;
~IAssistantAction() override;
......@@ -107,7 +107,7 @@ public:
IAssistant();
~IAssistant() override;
typedef QExplicitlySharedDataPointer<IAssistant> Ptr;
using Ptr = QExplicitlySharedDataPointer<IAssistant>;
///Returns the stored list of actions
QList<IAssistantAction::Ptr> actions() const;
......
......@@ -36,7 +36,7 @@ class DocumentRange;
class KDEVPLATFORMINTERFACES_EXPORT IProblem : public QSharedData
{
public:
typedef QExplicitlySharedDataPointer<IProblem> Ptr;
using Ptr = QExplicitlySharedDataPointer<IProblem>;
/// The source of the problem. That is which tool / which part found this problem.
enum Source {
......
......@@ -37,7 +37,7 @@ public:
/**
* Use this shared pointer to pass around the session lock.
*/
typedef QSharedPointer<ISessionLock> Ptr;
using Ptr = QSharedPointer<ISessionLock>;
virtual ~ISessionLock();
......
......@@ -37,7 +37,7 @@ public:
QString mimeType;
QString highlightMode;
};
typedef QVector<MimeHighlightPair> MimeList;
using MimeList = QVector<MimeHighlightPair>;
SourceFormatterStyle();
explicit SourceFormatterStyle( const QString& name );
......@@ -89,7 +89,7 @@ struct SourceFormatterStyleItem {
SourceFormatterStyle style;
};
typedef QVector<SourceFormatterStyleItem> SourceFormatterItemList;
using SourceFormatterItemList = QVector<SourceFormatterStyleItem>;
/**
* @short A widget to edit a style
......
......@@ -31,7 +31,7 @@
#include <language/duchain/topducontext.h>
#include <serialization/indexedstring.h>
typedef QPointer<KTextEditor::Document> SafeDocumentPointer;
using SafeDocumentPointer = QPointer<KTextEditor::Document>;
namespace KDevelop {
class IDocument;
......
......@@ -53,7 +53,7 @@ class KDEVPLATFORMLANGUAGE_EXPORT RevisionLockerAndClearer
: public QSharedData
{
public:
typedef QExplicitlySharedDataPointer<RevisionLockerAndClearer> Ptr;
using Ptr = QExplicitlySharedDataPointer<RevisionLockerAndClearer>;
~RevisionLockerAndClearer();
......@@ -124,7 +124,7 @@ private:
RevisionLockerAndClearerPrivate* m_p;
};
typedef RevisionLockerAndClearer::Ptr RevisionReference;
using RevisionReference = RevisionLockerAndClearer::Ptr;
class KDEVPLATFORMLANGUAGE_EXPORT DocumentChangeTracker
: public QObject
......
......@@ -105,7 +105,7 @@ ParseJob::ParseJob(const IndexedString& url, KDevelop::ILanguageSupport* languag
ParseJob::~ParseJob()
{
typedef QPointer<QObject> QObjectPointer;
using QObjectPointer = QPointer<QObject>;
foreach (const QObjectPointer& p, d->notify) {
if (p) {
QMetaObject::invokeMethod(p.data(), "updateReady", Qt::QueuedConnection,
......
......@@ -110,7 +110,7 @@ private:
void recursiveSortInternal();
protected:
typedef QList<Node*> NodesList;
using NodesList = QList<Node*>;
NodesList m_children;
QString m_displayName;
QIcon m_cachedIcon;
......@@ -225,7 +225,7 @@ protected: // ClassModelNodeDocumentChangedInterface overrides
void documentChanged(const KDevelop::IndexedString& a_file) override;
private:
typedef QMap<uint, Node*> SubIdentifiersMap;
using SubIdentifiersMap = QMap<uint, Node*>;
/// Set of known sub-identifiers. It's used for updates check.
SubIdentifiersMap m_subIdentifiers;
......
......@@ -67,7 +67,7 @@ private: // File updates related.
/// Timer for batch updates.
QTimer* m_updateTimer;
typedef QMultiMap<KDevelop::IndexedString, ClassModelNodeDocumentChangedInterface*> FilesMap;
using FilesMap = QMultiMap<KDevelop::IndexedString, ClassModelNodeDocumentChangedInterface*>;
/// Maps between monitored files and their class nodes.
FilesMap m_filesMap;
};
......
......@@ -101,17 +101,17 @@ private: // Opened class identifiers container definition.
struct ClassIdentifierIndex {};
// Member types definitions.
typedef boost::multi_index::member<
using FileMember = boost::multi_index::member<
OpenedFileClassItem,
KDevelop::IndexedString,
& OpenedFileClassItem::file> FileMember;
typedef boost::multi_index::member<
& OpenedFileClassItem::file>;
using ClassIdentifierMember = boost::multi_index::member<
OpenedFileClassItem,
KDevelop::IndexedQualifiedIdentifier,
& OpenedFileClassItem::classIdentifier> ClassIdentifierMember;
& OpenedFileClassItem::classIdentifier>;
// Container definition.
typedef boost::multi_index::multi_index_container<
using OpenFilesContainer = boost::multi_index::multi_index_container<
OpenedFileClassItem,
boost::multi_index::indexed_by<
boost::multi_index::ordered_non_unique<
......@@ -123,11 +123,11 @@ private: // Opened class identifiers container definition.
ClassIdentifierMember
>
>
> OpenFilesContainer;
>;
// Iterators definition.
typedef OpenFilesContainer::index_iterator<FileIndex>::type FileIterator;
typedef OpenFilesContainer::index_iterator<ClassIdentifierIndex>::type ClassIdentifierIterator;
using FileIterator = OpenFilesContainer::index_iterator<FileIndex>::type;
using ClassIdentifierIterator = OpenFilesContainer::index_iterator<ClassIdentifierIndex>::type;
/// Maps all displayed classes and their referenced files.
OpenFilesContainer m_openFilesClasses;
......@@ -136,7 +136,7 @@ private: // Opened class identifiers container definition.
QSet<KDevelop::IndexedString> m_openFiles;
private:
typedef QMap<KDevelop::IndexedQualifiedIdentifier, StaticNamespaceFolderNode*> NamespacesMap;
using NamespacesMap = QMap<KDevelop::IndexedQualifiedIdentifier, StaticNamespaceFolderNode*>;
/// Holds a map between an identifier and a namespace folder we hold.
NamespacesMap m_namespaces;
......
......@@ -25,7 +25,7 @@
using namespace KDevelop;
typedef PushValue<int> IntPusher;
using IntPusher = PushValue<int>;
///Extracts the last line from the given string
QString CodeCompletionContext::extractLastLine(const QString& str)
......
......@@ -34,8 +34,8 @@ class CursorInRevision;
class CompletionTreeItem;
class CompletionTreeElement;
typedef QExplicitlySharedDataPointer<CompletionTreeItem> CompletionTreeItemPointer;
typedef QExplicitlySharedDataPointer<CompletionTreeElement> CompletionTreeElementPointer;
using CompletionTreeItemPointer = QExplicitlySharedDataPointer<CompletionTreeItem>;
using CompletionTreeElementPointer = QExplicitlySharedDataPointer<CompletionTreeElement>;
/**
* This class is responsible for finding out what kind of completion is needed, what expression should be evaluated for the container-class of the completion, what conversion will be applied to the result of the completion, etc.
......@@ -44,7 +44,7 @@ class KDEVPLATFORMLANGUAGE_EXPORT CodeCompletionContext
: public QSharedData
{
public:
typedef QExplicitlySharedDataPointer<CodeCompletionContext> Ptr;
using Ptr = QExplicitlySharedDataPointer<CodeCompletionContext>;
/**
* @param text the text to analyze. It usually is the text in the range starting at the beginning of the context,
......
......@@ -148,8 +148,8 @@ struct KDEVPLATFORMLANGUAGE_EXPORT CompletionCustomGroupNode
int inheritanceDepth;
};
typedef QExplicitlySharedDataPointer<CompletionTreeItem> CompletionTreeItemPointer;
typedef QExplicitlySharedDataPointer<CompletionTreeElement> CompletionTreeElementPointer;
using CompletionTreeItemPointer = QExplicitlySharedDataPointer<CompletionTreeItem>;
using CompletionTreeElementPointer = QExplicitlySharedDataPointer<CompletionTreeElement>;
}
Q_DECLARE_METATYPE(KDevelop::CompletionTreeElementPointer)
......
......@@ -47,12 +47,12 @@ struct CodeCompletionItemLastGrouper
template <class KeyExtractor, class NextGrouper = CodeCompletionItemLastGrouper>
struct CodeCompletionItemGrouper
{
typedef typename KeyExtractor::KeyType KeyType;
using KeyType = typename KeyExtractor::KeyType;
CodeCompletionItemGrouper(QList<QExplicitlySharedDataPointer<CompletionTreeElement>>& tree,
CompletionTreeNode* parent, const QList<CompletionTreeItemPointer>& items)
{
typedef QMap<KeyType, QList<CompletionTreeItemPointer>> GroupMap;
using GroupMap = QMap<KeyType, QList<CompletionTreeItemPointer>>;
GroupMap groups;
for (auto& item : items) {
......@@ -81,7 +81,7 @@ struct CodeCompletionItemGrouper
///Extracts the argument-hint depth from completion-items, to be used in ItemGrouper for grouping by argument-hint depth.
struct ArgumentHintDepthExtractor
{
typedef int KeyType;
using KeyType = int;
enum { Role = KTextEditor::CodeCompletionModel::ArgumentHintDepth };
static KeyType extract(const CompletionTreeItemPointer& item)
......@@ -92,7 +92,7 @@ struct ArgumentHintDepthExtractor
struct InheritanceDepthExtractor
{
typedef int KeyType;
using KeyType = int;
enum { Role = KTextEditor::CodeCompletionModel::InheritanceDepth };
......@@ -104,7 +104,7 @@ struct InheritanceDepthExtractor
struct SimplifiedAttributesExtractor
{
typedef int KeyType;
using KeyType = int;
enum { Role = KTextEditor::CodeCompletionModel::CompletionRole };
......
......@@ -125,8 +125,8 @@ protected:
const QModelIndex& index) const override;
QExplicitlySharedDataPointer<CodeCompletionContext> m_completionContext;
typedef QPair<KDevelop::DeclarationPointer,
QExplicitlySharedDataPointer<CodeCompletionContext>> DeclarationContextPair;
using DeclarationContextPair = QPair<KDevelop::DeclarationPointer,
QExplicitlySharedDataPointer<CodeCompletionContext>>;
QList<QExplicitlySharedDataPointer<CompletionTreeElement>> m_completionItems;
......
......@@ -52,7 +52,7 @@ public:
delete m_node;
}
typedef QList<AstNodeRef*> AstNodeList;
using AstNodeList = QList<AstNodeRef*>;
/**
* \short Container class for a change to an AST node.
......
......@@ -83,7 +83,7 @@ struct KDEVPLATFORMLANGUAGE_EXPORT VariableDescription
/**
* List of variable descriptions
**/
typedef QVector<VariableDescription> VariableDescriptionList;
using VariableDescriptionList = QVector<VariableDescription>;
/**
* @brief Represents a function
......@@ -184,7 +184,7 @@ struct KDEVPLATFORMLANGUAGE_EXPORT FunctionDescription
/**
* List of function descriptions
**/
typedef QVector<FunctionDescription> FunctionDescriptionList;
using FunctionDescriptionList = QVector<FunctionDescription>;
/**
* Description of an inheritance relation.
......@@ -210,7 +210,7 @@ struct KDEVPLATFORMLANGUAGE_EXPORT InheritanceDescription
/**
* List of inheritance descriptions
**/
typedef QVector<InheritanceDescription> InheritanceDescriptionList;
using InheritanceDescriptionList = QVector<InheritanceDescription>;
/**
* @brief Represents a class
......
......@@ -163,8 +163,8 @@ public:
protected:
/// Convenience definition of the TopAstNode that is contained by this AstContainer
typedef typename AstContainer::TopAstNode TopAstNode;
typedef AstChangeSet<TopAstNode> LanguageChangeSet;
using TopAstNode = typename AstContainer::TopAstNode ;
using LanguageChangeSet = AstChangeSet<TopAstNode>;
/**
* Query an AST of a particular file
......@@ -242,7 +242,7 @@ protected:
}
private:
typedef QMap<IndexedString, typename AstContainer::Ptr> AstContainerMap;
using AstContainerMap = QMap<IndexedString, typename AstContainer::Ptr>;
AstContainerMap m_AstContainers;
};
}
......
......@@ -86,7 +86,7 @@ struct KDevEditingTransaction
// NOTE: It's important to close the transaction first and only then destroy the EditorDisableReplaceTabs. Otherwise we hit asserts in KTextEditor.
KTextEditor::Document::EditingTransaction edit;
EditorDisableReplaceTabs disableReplaceTabs;
typedef std::unique_ptr<KDevEditingTransaction> Ptr;
using Ptr = std::unique_ptr<KDevEditingTransaction>;
};
/**
......@@ -133,7 +133,7 @@ public:
*/
static QString artificialPath(const QString& name);
typedef QExplicitlySharedDataPointer<CodeRepresentation> Ptr;
using Ptr = QExplicitlySharedDataPointer<CodeRepresentation>;
};
class KDEVPLATFORMLANGUAGE_EXPORT DynamicCodeRepresentation
......@@ -146,7 +146,7 @@ public:
virtual bool replace(const KTextEditor::Range& range, const QString& oldText,
const QString& newText, bool ignoreOldText = false) = 0;
typedef QExplicitlySharedDataPointer<DynamicCodeRepresentation> Ptr;
using Ptr = QExplicitlySharedDataPointer<DynamicCodeRepresentation>;
};
/**
......@@ -191,7 +191,7 @@ private:
IndexedString m_file;
};
typedef QExplicitlySharedDataPointer<InsertArtificialCodeRepresentation> InsertArtificialCodeRepresentationPointer;
using InsertArtificialCodeRepresentationPointer = QExplicitlySharedDataPointer<InsertArtificialCodeRepresentation>;
}
#endif
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