Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
22 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion libqf/libqfcore/src/core/utils.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -279,10 +279,15 @@ QVariant Utils::jsonToQVariant(const QString &json)
}

QString Utils::qvariantToJson(const QVariant &v, bool compact)
{
return QString::fromUtf8(qvariantToJsonUtf8(v, compact));
}

QByteArray Utils::qvariantToJsonUtf8(const QVariant &v, bool compact)
{
auto doc = QJsonDocument::fromVariant(v);
auto ba = doc.toJson(compact? QJsonDocument::Compact: QJsonDocument::Indented);
return QString::fromUtf8(ba);
return ba;
}

}
1 change: 1 addition & 0 deletions libqf/libqfcore/src/core/utils.h
Original file line number Diff line number Diff line change
Expand Up @@ -213,6 +213,7 @@ class QFCORE_DECL_EXPORT Utils

static QVariant jsonToQVariant(const QString &json);
static QString qvariantToJson(const QVariant &v, bool compact = true);
static QByteArray qvariantToJsonUtf8(const QVariant &v, bool compact = true);
};

}}
Expand Down
5 changes: 5 additions & 0 deletions libqf/libqfqmlwidgets/src/framework/application.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,11 @@ Application::Application(int &argc, char **argv) :
{
}

QString Application::versionString() const
{
return QCoreApplication::applicationVersion();
}

Application::~Application()
= default;

Expand Down
4 changes: 3 additions & 1 deletion libqf/libqfqmlwidgets/src/framework/application.h
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,9 @@ class QFQMLWIDGETS_DECL_EXPORT Application : public QApplication
typedef QApplication Super;
public:
explicit Application(int & argc, char ** argv);
~Application() Q_DECL_OVERRIDE;
~Application() override;

Q_INVOKABLE QString versionString() const;
public:
static Application* instance(bool must_exist = true);
MainWindow* frameWork();
Expand Down
2 changes: 2 additions & 0 deletions quickevent/app/quickevent/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,8 @@ add_executable(quickevent
plugins/Event/src/services/qx/qxlateregistrationswidget.h
plugins/Event/src/services/qx/qxlateregistrationswidget.cpp
plugins/Event/src/services/qx/qxlateregistrationswidget.ui
plugins/Event/src/services/qx/runchangedialog.h plugins/Event/src/services/qx/runchangedialog.cpp plugins/Event/src/services/qx/runchangedialog.ui
plugins/Event/src/services/qx/runchange.h plugins/Event/src/services/qx/runchange.cpp

plugins/Oris/src/chooseoriseventdialog.cpp
plugins/Oris/src/chooseoriseventdialog.ui
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -532,7 +532,6 @@ bool CardReaderPlugin::processCardToRunAssignment(int card_id, int run_id)
QVariantList param {
next_leg_run_id,
QVariantMap {
{"runs.id", next_leg_run_id},
{"runs.startTimeMs", new_next_leg_start_time},
}
};
Expand Down
10 changes: 7 additions & 3 deletions quickevent/app/quickevent/plugins/Classes/src/classeswidget.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -192,9 +192,13 @@ ClassesWidget::ClassesWidget(QWidget *parent) :
//m->addColumn("courses.name", tr("Course")).setReadOnly(true);
m->addColumn("courses.length", tr("Length"));
m->addColumn("courses.climb", tr("Climb"));
m->addColumn("relaysCount", tr("Count")).setToolTip(tr("Relays count"));
m->addColumn("classdefs.relayStartNumber", tr("Rel.num")).setToolTip(tr("Relay start number"));
m->addColumn("classdefs.relayLegCount", tr("Legs")).setToolTip(tr("Relay leg count"));

if (auto is_relays = getPlugin<EventPlugin>()->eventConfig()->isRelays(); is_relays) {
m->addColumn("relaysCount", tr("Rel. count")).setToolTip(tr("Relays count"));
m->addColumn("classdefs.relayStartNumber", tr("Rel. num")).setToolTip(tr("Relay start number"));
m->addColumn("classdefs.relayLegCount", tr("Legs")).setToolTip(tr("Relay leg count"));
}

ui->tblClasses->setTableModel(m);

m_courseItemDelegate = new CourseItemDelegate(this);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -101,8 +101,9 @@ bool CompetitorDocument::saveData()
else {
competitor_id = dataId().toInt();
}
if(m_isEmitDbEventsOnSave)
if(m_isEmitDbEventsOnSave) {
getPlugin<EventPlugin>()->emitDbEvent(Event::EventPlugin::DBEVENT_COMPETITOR_EDITED, competitor_id);
}
}
return ret;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -259,6 +259,29 @@
</property>
</spacer>
</item>
<item>
<widget class="QLabel" name="label_11">
<property name="text">
<string>ID</string>
</property>
<property name="buddy">
<cstring>edSiId</cstring>
</property>
</widget>
</item>
<item>
<widget class="quickevent::gui::si::SiIdEdit" name="edCompetitorId">
<property name="alignment">
<set>Qt::AlignmentFlag::AlignRight|Qt::AlignmentFlag::AlignTrailing|Qt::AlignmentFlag::AlignVCenter</set>
</property>
<property name="readOnly">
<bool>true</bool>
</property>
<property name="dataId" stdset="0">
<string notr="true">competitors.id</string>
</property>
</widget>
</item>
</layout>
</item>
</layout>
Expand Down
7 changes: 5 additions & 2 deletions quickevent/app/quickevent/plugins/Event/qml/DbSchema.qml
Original file line number Diff line number Diff line change
Expand Up @@ -490,15 +490,18 @@ Schema {
Field { name: 'id'; type: Serial { primaryKey: true } },
Field { name: 'stage_id'; type: Int { } },
Field { name: 'change_id'; type: Int { } },
Field { name: 'run_id'; type: Int { } },
Field { name: 'data_id'; type: Int { } },
Field { name: 'data_type'; type: String { } },
Field { name: 'data'; type: String { } },
Field { name: 'orig_data'; type: String { }
comment: 'Store data overriden by change here to enable change rollback.'
},
Field { name: 'source'; type: String { } },
Field { name: 'user_id'; type: String { } },
Field { name: 'status'; type: String { } },
Field { name: 'status_message'; type: String { } },
Field { name: 'created'; type: DateTime { } },
Field { name: 'row_lock'; type: Int { } }
Field { name: 'lock_number'; type: Int { } }
]
indexes: [
Index {fields: ['stage_id', 'change_id']; unique: true }
Expand Down
Loading