Skip to content

Commit

Permalink
Merge pull request #379 from jmlich/improve-debug-messages
Browse files Browse the repository at this point in the history
[kirigami] Minor improvements
  • Loading branch information
piggz authored Jun 2, 2024
2 parents e5ab77c + 425b0e1 commit 21e3ddc
Show file tree
Hide file tree
Showing 6 changed files with 14 additions and 7 deletions.
4 changes: 4 additions & 0 deletions daemon/src/harbour-amazfish-daemon.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,11 @@ void myMessageOutput(QtMsgType type, const QMessageLogContext &context, const QS
{
QByteArray localMsg = msg.toLocal8Bit();
const char* time = QDateTime::currentDateTime().toString("yyyy-MM-dd hh:mm:ss.zzz").toLocal8Bit();
#ifdef QT_MESSAGELOGCONTEXT
fprintf(stderr,"%s %s:%d: %s\n", time, context.file, context.line, localMsg.constData());
#else
fprintf(stderr, "%s : %s\n", time, localMsg.constData());
#endif
}

int main(int argc, char **argv)
Expand Down
2 changes: 1 addition & 1 deletion ui/qml/components/platform.kirigami/ListItemPL.qml
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ import "."
Item {
id: root
height: item.height
width: parent.width
width: parent !== null ? parent.width : undefined

default property alias content: itemData.data
property real contentHeight
Expand Down
4 changes: 3 additions & 1 deletion ui/qml/components/platform.kirigami/PagePL.qml
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,9 @@ Kirigami.ScrollablePage {
enabled: page.canNavigateForward === true
icon.name: page.acceptIconName
visible: !page.hideAcceptButton && (page.isDialog || app.pages.hasAttached(page))
text: "" + (page.isDialog ? app.tr("Accept") : app.pages.nextPage().title)
text: "" + (page.isDialog || app.pages.nextPage() == undefined
? app.tr("Accept")
: app.pages.nextPage().title)
onTriggered: {
if (acceptCallback) acceptCallback();
else app.pages.navigateForward();
Expand Down
7 changes: 4 additions & 3 deletions ui/qml/components/platform.qtcontrols/TimePickerDialogPL.qml
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ DialogPL {
maximumLength: 2
validator: IntValidator { bottom: 0; top: 23 }
Keys.onReturnPressed: gM.focus = true
onTextChanged: hours = parseInt(text)
onTextChanged: hour = parseInt(text)
}

LabelPL {
Expand All @@ -70,8 +70,9 @@ DialogPL {
hour = time.getHours();
minute = time.getMinutes();
}
gH.text = ("00" + hour).substr(-2);
gM.text = ("00" + minute).substr(-2);
// NaN value is converted to -2147483648
gH.text = (hour >= 0) ? ("00" + hour).substr(-2) : "00";
gM.text = (minute >= 0) ? ("00" + minute).substr(-2) : "00";
gH.forceActiveFocus();
}

Expand Down
2 changes: 1 addition & 1 deletion ui/qml/harbour-amazfish.qml
Original file line number Diff line number Diff line change
Expand Up @@ -215,7 +215,7 @@ ApplicationWindowPL
}

function supportsFeature(feature) {
console.log("Checking if feature is supported:", feature, (supportedFeatures & feature) === feature);
// console.log("Checking if feature is supported:", feature, (supportedFeatures & feature) === feature);
return (supportedFeatures & feature) === feature;
}

Expand Down
2 changes: 1 addition & 1 deletion ui/src/daemoninterface.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ void DaemonInterface::connectDaemon()

void DaemonInterface::pair(const QString &name, QString address)
{
qDebug() << Q_FUNC_INFO;
qDebug() << Q_FUNC_INFO << name << address;

if (m_connectionState == "pairing") {
return;
Expand Down

0 comments on commit 21e3ddc

Please sign in to comment.