Commit b47661d7 authored by Friedrich W. H. Kossebau's avatar Friedrich W. H. Kossebau

Merge branch '5.5'

parents d51f568f 81fdc7cf
......@@ -122,7 +122,7 @@ struct DocumentParseTarget
inline uint qHash(const DocumentParseTarget& target)
{
return target.features * 7 + target.priority * 13 + target.sequentialProcessingFlags * 17
+ reinterpret_cast<size_t>(target.notifyWhenReady.data());
+ static_cast<uint>(reinterpret_cast<quintptr>(target.notifyWhenReady.data()));
}
struct DocumentParsePlan
......
......@@ -179,7 +179,7 @@ int64_t ClassMemberDeclaration::alignOf() const
if (d_func()->m_alignOfExponent == ClassMemberDeclarationData::MaxAlignOfExponent) {
return -1;
} else {
return 1 << d_func()->m_alignOfExponent;
return Q_INT64_C(1) << d_func()->m_alignOfExponent;
}
}
......
......@@ -246,8 +246,9 @@ QString ProblemNavigationContext::html(bool shorten)
NavigationContextPointer ProblemNavigationContext::executeKeyAction(const QString& key)
{
if (key.startsWith(QLatin1String("invoke_action_"))) {
const int index = key.midRef(strlen("invoke_action_")).toInt();
const QLatin1String invokeActionPrefix("invoke_action_");
if (key.startsWith(invokeActionPrefix)) {
const int index = key.midRef(invokeActionPrefix.size()).toInt();
executeAction(index);
}
......
......@@ -1004,7 +1004,12 @@ void TopDUContext::clearProblems()
QVector<DUContext*> TopDUContext::importers() const
{
ENSURE_CAN_READ
#if QT_VERSION >= QT_VERSION_CHECK(5, 14, 0)
const QSet<DUContext*>& directImporters = m_local->m_directImporters;
return QVector<DUContext*>(directImporters.begin(), directImporters.end());
#else
return QVector<DUContext*>::fromList(m_local->m_directImporters.values());
#endif
}
QList<DUContext*> TopDUContext::loadedImporters() const
......
......@@ -61,7 +61,7 @@ struct TestItemRequest
}
//Should return the size of an item created with createItem
size_t itemSize() const
uint itemSize() const
{
return m_item.itemSize();
}
......
......@@ -293,7 +293,7 @@ public:
uint size() const
{
return realSet.size();
return static_cast<uint>(realSet.size());
}
uint getItem(uint number) const
......@@ -643,8 +643,8 @@ private Q_SLOTS:
Extractor, UintSetVisitor> visit(v, set1.iterator(), repSet2);
}
totalItems += testSet1.size();
totalFilteredItems += algoFiltered.size();
totalItems += static_cast<uint>(testSet1.size());
totalFilteredItems += static_cast<uint>(algoFiltered.size());
std::set<uint> stdFiltered;
......
......@@ -29,7 +29,6 @@
#include <interfaces/iruntime.h>
#include <interfaces/iruntimecontroller.h>
#include <KColorScheme>
#include <KLocalizedString>
#include <QDir>
......@@ -283,14 +282,8 @@ void CMakeBuildDirChooser::setExtraArguments(const QString& args)
void CMakeBuildDirChooser::setStatus(const QString& message, bool canApply)
{
KColorScheme scheme(QPalette::Normal);
KColorScheme::ForegroundRole role;
if (canApply) {
role = KColorScheme::PositiveText;
} else {
role = KColorScheme::NegativeText;
}
m_chooserUi->status->setText(QStringLiteral("<i><font color='%1'>%2</font></i>").arg(scheme.foreground(role).color().name(), message));
m_chooserUi->status->setMessageType(canApply ? KMessageWidget::Positive : KMessageWidget::Warning);
m_chooserUi->status->setText(message);
auto okButton = m_buttonBox->button(QDialogButtonBox::Ok);
okButton->setEnabled(canApply);
......
......@@ -65,7 +65,20 @@
</property>
</widget>
</item>
<item row="3" column="0">
<item row="3" column="1">
<widget class="KMessageWidget" name="status">
<property name="closeButtonVisible">
<bool>false</bool>
</property>
<property name="sizePolicy">
<sizepolicy hsizetype="Expanding" vsizetype="Preferred">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
</widget>
</item>
<item row="4" column="0">
<widget class="QLabel" name="label">
<property name="text">
<string>&amp;Installation prefix:</string>
......@@ -78,7 +91,7 @@
</property>
</widget>
</item>
<item row="3" column="1">
<item row="4" column="1">
<widget class="KUrlRequester" name="installPrefix">
<property name="sizePolicy">
<sizepolicy hsizetype="Expanding" vsizetype="Preferred">
......@@ -100,7 +113,7 @@
</property>
</widget>
</item>
<item row="4" column="0">
<item row="5" column="0">
<widget class="QLabel" name="label_2">
<property name="text">
<string>Build &amp;type:</string>
......@@ -113,7 +126,7 @@
</property>
</widget>
</item>
<item row="4" column="1">
<item row="5" column="1">
<widget class="QComboBox" name="buildType">
<property name="editable">
<bool>true</bool>
......@@ -143,14 +156,14 @@
</item>
</widget>
</item>
<item row="5" column="0">
<item row="6" column="0">
<widget class="QLabel" name="label_4">
<property name="text">
<string>Extra arguments:</string>
</property>
</widget>
</item>
<item row="5" column="1">
<item row="6" column="1">
<widget class="KComboBox" name="extraArguments">
<property name="sizePolicy">
<sizepolicy hsizetype="Expanding" vsizetype="Fixed">
......@@ -163,7 +176,7 @@
</property>
</widget>
</item>
<item row="6" column="0">
<item row="7" column="0">
<widget class="QLabel" name="label_5">
<property name="text">
<string>CMake &amp;executable:</string>
......@@ -176,7 +189,7 @@
</property>
</widget>
</item>
<item row="6" column="1">
<item row="7" column="1">
<widget class="KUrlRequester" name="cmakeExecutable">
<property name="sizePolicy">
<sizepolicy hsizetype="Expanding" vsizetype="Preferred">
......@@ -186,16 +199,6 @@
</property>
</widget>
</item>
<item row="7" column="0" colspan="2">
<widget class="QLabel" name="status">
<property name="text">
<string notr="true">Status Message...</string>
</property>
<property name="wordWrap">
<bool>true</bool>
</property>
</widget>
</item>
</layout>
</widget>
<customwidgets>
......@@ -209,6 +212,11 @@
<extends>QWidget</extends>
<header>KUrlRequester</header>
</customwidget>
<customwidget>
<class>KMessageWidget</class>
<extends>QFrame</extends>
<header>KMessageWidget</header>
</customwidget>
</customwidgets>
<resources/>
<connections/>
......
......@@ -184,6 +184,7 @@ GrepDialog::GrepDialog(GrepViewPlugin *plugin, QWidget *parent, bool show)
setWindowTitle( i18n("Find/Replace in Files") );
setupUi(this);
patternCombo->lineEdit()->setClearButtonEnabled(true);
adjustSize();
auto searchButton = buttonBox->button(QDialogButtonBox::Ok);
......
......@@ -66,7 +66,7 @@ private:
inline int OutlineNode::childCount() const
{
return m_children.size();
return static_cast<int>(m_children.size());
}
inline const std::vector<OutlineNode>& OutlineNode::children() const
......@@ -90,7 +90,7 @@ inline int OutlineNode::indexOf(const OutlineNode* child) const
// Comparing the address here is only fine since we never modify the vector after initial creation
for (size_t i = 0; i < max; i++) {
if (child == &m_children[i]) {
return i;
return static_cast<int>(i);
}
}
return -1;
......
......@@ -12,7 +12,10 @@ set(kdevqmakeparser_SRCS
qmakeastdefaultvisitor.cpp
)
kdevpgqt_generate(parser_GEN_SRCS qmake NAMESPACE QMake DUMP_INFO
if(NOT KDevelop-PG-Qt_VERSION VERSION_LESS "2.2.1")
set(_kdevpgqt_generate_extra_args ENFORCE_COMPATIBLE_ERROR_AWARE_CODE)
endif()
kdevpgqt_generate(parser_GEN_SRCS qmake NAMESPACE QMake DUMP_INFO ${_kdevpgqt_generate_extra_args}
"${CMAKE_CURRENT_SOURCE_DIR}/qmake.g"
"${CMAKE_CURRENT_SOURCE_DIR}/qmakelexer.h")
......@@ -37,3 +40,7 @@ target_link_libraries(kdevqmakeparser
KF5::KIOCore
)
target_include_directories(kdevqmakeparser PUBLIC ${CMAKE_CURRENT_SOURCE_DIR})
# for proper include stack reports with gcc when working on the parser:
# remove ENFORCE_COMPATIBLE_ERROR_AWARE_CODE from kdevpgqt_generate
# uncomment next line:
# add_target_compile_flag_if_supported(kdevqmakeparser PRIVATE "-Wno-pedantic")
......@@ -202,12 +202,14 @@ QStringList QMakeProjectFile::includeDirectories() const
QString pattern = module;
bool isPrivate = false;
if (module.endsWith(QLatin1String("-private"))) {
pattern.chop(qstrlen("-private"));
const QLatin1String dashPrivateLineEnd("-private");
const QLatin1String underscorePrivateLineEnd("_private");
if (module.endsWith(dashPrivateLineEnd)) {
pattern.chop(dashPrivateLineEnd.size());
isPrivate = true;
} else if (module.endsWith(QLatin1String("_private"))) {
} else if (module.endsWith(underscorePrivateLineEnd)) {
// _private is less common, but still a valid suffix
pattern.chop(qstrlen("_private"));
pattern.chop(underscorePrivateLineEnd.size());
isPrivate = true;
}
......
......@@ -46,8 +46,9 @@ QString repairDiff(const QString& diff) {
QStringList lines = diff.split(QLatin1Char('\n'));
QMap<QString, QString> headers;
for(int a = 0; a < lines.size()-1; ++a) {
if(lines[a].startsWith(QLatin1String("Index: ")) && lines[a+1].startsWith(QLatin1String("====="))) {
const QString fileName = lines[a].midRef(strlen("Index: ")).trimmed().toString();
const QLatin1String indexLineBegin("Index: ");
if(lines[a].startsWith(indexLineBegin) && lines[a+1].startsWith(QLatin1String("====="))) {
const QString fileName = lines[a].midRef(indexLineBegin.size()).trimmed().toString();
headers[fileName] = lines[a];
qCDebug(PLUGIN_SVN) << "found header for" << fileName;
lines[a] = QString();
......@@ -61,8 +62,9 @@ QString repairDiff(const QString& diff) {
QRegExp spaceRegExp(QStringLiteral("\\s"));
for(int a = 0; a < lines.size()-1; ++a) {
if(lines[a].startsWith(QLatin1String("--- "))) {
QString tail = lines[a].mid(strlen("--- "));
const QLatin1String threeDashLineBegin("--- ");
if(lines[a].startsWith(threeDashLineBegin)) {
QString tail = lines[a].mid(threeDashLineBegin.size());
if(tail.indexOf(spaceRegExp) != -1) {
QString file = tail.left(tail.indexOf(spaceRegExp));
qCDebug(PLUGIN_SVN) << "checking for" << file;
......
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