Skip to content

Commit

Permalink
add permalinks and licence + small review fix
Browse files Browse the repository at this point in the history
  • Loading branch information
tomasMizera committed Jun 18, 2021
1 parent d2fdda0 commit ce8cd4d
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 8 deletions.
6 changes: 2 additions & 4 deletions app/attributes/attributecontroller.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -661,21 +661,19 @@ bool AttributeController::constraintsSoftValid() const

bool AttributeController::featureCanBeSaved()
{
bool allFieldsAreValid = true;

// loop over items and see if there is someone with invalid state
QMap<QUuid, std::shared_ptr<FormItem>>::iterator formItemsIterator = mFormItems.begin();
while ( formItemsIterator != mFormItems.end() )
{
std::shared_ptr<FormItem> item = formItemsIterator.value();
if ( item->state() != FormItem::Valid )
{
allFieldsAreValid = false;
return false;
}
++formItemsIterator;
}

return mConstraintsHardValid && allFieldsAreValid;
return mConstraintsHardValid;
}

bool AttributeController::hasTabs() const
Expand Down
13 changes: 11 additions & 2 deletions app/editor/rangewidgethelper.cpp
Original file line number Diff line number Diff line change
@@ -1,4 +1,13 @@
#include "rangewidgethelper.h"
/***************************************************************************
* *
* This program is free software; you can redistribute it and/or modify *
* it under the terms of the GNU General Public License as published by *
* the Free Software Foundation; either version 2 of the License, or *
* (at your option) any later version. *
* *
***************************************************************************/

#include "rangewidgethelper.h"

#include <QtMath>

Expand Down Expand Up @@ -57,7 +66,7 @@ void RangeWidgetHelper::setup()

// don't ever use a step smaller than would be visible in the widget
// i.e. if showing 2 decimals, smallest increment will be 0.01
// https://github.com/qgis/QGIS/blob/master/src/gui/editorwidgets/qgsdoublespinbox.cpp
// https://github.com/qgis/QGIS/blob/a038a79997fb560e797daf3903d94c7d68e25f42/src/gui/editorwidgets/qgsdoublespinbox.cpp#L83-L87
if ( mWidgetConfig.contains( "Step" ) )
{
mStep = qMax( mWidgetConfig["Step"].toDouble(), qPow( 10.0, 0.0 - mPrecision ) );
Expand Down
11 changes: 10 additions & 1 deletion app/editor/rangewidgethelper.h
Original file line number Diff line number Diff line change
@@ -1,4 +1,13 @@
#ifndef NUMBERWIDGETHANDLER_H
/***************************************************************************
* *
* This program is free software; you can redistribute it and/or modify *
* it under the terms of the GNU General Public License as published by *
* the Free Software Foundation; either version 2 of the License, or *
* (at your option) any later version. *
* *
***************************************************************************/

#ifndef NUMBERWIDGETHANDLER_H
#define NUMBERWIDGETHANDLER_H

#include <QObject>
Expand Down
2 changes: 1 addition & 1 deletion app/qml/editor/inputrangeeditable.qml
Original file line number Diff line number Diff line change
Expand Up @@ -226,7 +226,7 @@ Item {
}

// on press and hold behavior can be used from here:
// https://github.com/mburakov/qt5/blob/master/qtquickcontrols/src/controls/SpinBox.qml#L306
// https://github.com/mburakov/qt5/blob/93bfa3874c10f6cb5aa376f24363513ba8264117/qtquickcontrols/src/controls/SpinBox.qml#L306-L309
}
}
}
Expand Down

2 comments on commit ce8cd4d

@inputapp-bot
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

signed apk: armeabi-v7a (SDK: android-22)

@inputapp-bot
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

signed apk: arm64-v8a (SDK: android-22)

Please sign in to comment.