Skip to content
This repository was archived by the owner on Sep 30, 2024. It is now read-only.

Commit a040609

Browse files
committed
support for qt 5.12 (Ubuntu 20.04)
1 parent 4baaa46 commit a040609

File tree

7 files changed

+53
-3
lines changed

7 files changed

+53
-3
lines changed

src/duqf-utils/duqflogger.cpp

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,14 @@ DuQFLogger::DuQFLogger(QObject *parent) : QObject(parent)
5454

5555
// === Log
5656

57+
DuQFLog::DuQFLog()
58+
{
59+
_m = "";
60+
_t = DuQFLog::Data;
61+
_c = "";
62+
_time = QTime::currentTime().toString("[hh:mm:ss.zzz]: ");
63+
}
64+
5765
DuQFLog::DuQFLog(QString message, DuQFLog::LogType type, QString component)
5866
{
5967
_m = message;
@@ -90,6 +98,14 @@ DuQFLog::DuQFLog(QString message, DuQFLog::LogType type, QString component)
9098
}
9199
}
92100

101+
DuQFLog::DuQFLog(const DuQFLog &l)
102+
{
103+
_m = l.message();
104+
_t = l.type();
105+
_c = l.component();
106+
_time = l.timeString();
107+
}
108+
93109
QString DuQFLog::message() const
94110
{
95111
return _m;

src/duqf-utils/duqflogger.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,9 @@ class DuQFLog
1919
Critical = 3,
2020
Fatal = 4 };
2121

22+
explicit DuQFLog();
2223
explicit DuQFLog(QString message, LogType type = Information, QString component = "");
24+
DuQFLog(const DuQFLog& l); // Copy constructor
2325

2426
QString message() const;
2527
LogType type() const;

src/duqf-widgets/duqfservercombobox.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,10 @@ DuQFServerComboBox::DuQFServerComboBox(QString defaultAddress, QWidget *parent):
44
QComboBox(parent)
55
{
66
this->setEditable(true);
7+
8+
#if (QT_VERSION >= QT_VERSION_CHECK(5, 15, 0))
79
this->setPlaceholderText("sub.domain.tld");
10+
#endif
811

912
// Get the server history
1013
int historySize = m_settings.beginReadArray("server/serverHistory");

src/duqf-widgets/duqftextedit.cpp

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,11 @@ void DuQFTextEdit::finishEditing()
4848
// Remember cursor position to reset it
4949
if (m_changed) {
5050
QTextCursor cursor = this->textCursor();
51-
if (m_useMarkdown) this->setMarkdown( this->toMarkdown() );
51+
52+
#if (QT_VERSION >= QT_VERSION_CHECK(5, 15, 0))
53+
if (m_useMarkdown) this->setMarkdown( this->toMarkdown() );
54+
#endif
55+
5256
this->setTextCursor(cursor);
5357
emit editingFinished();
5458
}
@@ -162,17 +166,25 @@ void DuQFTextEdit::setCaptureEnterKey(bool newCaptureEnterKey)
162166

163167
void DuQFTextEdit::showMarkdown()
164168
{
169+
#if (QT_VERSION < QT_VERSION_CHECK(5, 15, 0))
170+
return;
171+
#else
165172
if (!m_useMarkdown) return;
166173
showRichText();
167174
QString source = this->toMarkdown();
168175
this->setCurrentCharFormat(QTextCharFormat());
169176
this->setPlainText( source );
177+
#endif
170178
}
171179

172180
void DuQFTextEdit::showRichText()
173181
{
182+
#if (QT_VERSION < QT_VERSION_CHECK(5, 15, 0))
183+
return;
184+
#else
174185
if (!m_useMarkdown) return;
175186
this->setMarkdown( this->toMarkdown() );
187+
#endif
176188
}
177189

178190
void DuQFTextEdit::pasteNoFormatting()

src/rameditwidgets/objecteditwidget.cpp

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,12 @@ void ObjectEditWidget::setComment()
121121
{
122122
if (!m_object) return;
123123

124+
#if (QT_VERSION < QT_VERSION_CHECK(5, 15, 0))
125+
m_object->setComment(ui_commentEdit->toPlainText());
126+
#else
124127
m_object->setComment(ui_commentEdit->toMarkdown());
128+
#endif
129+
125130
}
126131

127132
void ObjectEditWidget::objectRemoved(RamObject *o)

src/rameditwidgets/statuseditwidget.cpp

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,11 @@ void StatusEditWidget::reInit(RamObject *o)
5151
ui_stateBox->update();
5252
ui_completionBox->setValue(m_status->completionRatio());
5353
ui_versionBox->setValue(m_status->version());
54-
ui_statusCommentEdit->setMarkdown(m_status->comment());
54+
#if (QT_VERSION < QT_VERSION_CHECK(5, 15, 0))
55+
ui_statusCommentEdit->setPlainText(m_status->comment());
56+
#else
57+
ui_statusCommentEdit->setMarkdown(m_status->comment());
58+
#endif
5559
ui_folderWidget->setPath( m_status->path() );
5660
ui_publishedBox->setChecked( m_status->isPublished() );
5761

@@ -233,7 +237,12 @@ void StatusEditWidget::setCompletion(int c)
233237
void StatusEditWidget::setComment()
234238
{
235239
if (!m_status) return;
240+
#if (QT_VERSION < QT_VERSION_CHECK(5, 15, 0))
241+
m_status->setComment( ui_statusCommentEdit->toPlainText() );
242+
#else
236243
m_status->setComment( ui_statusCommentEdit->toMarkdown() );
244+
#endif
245+
237246
}
238247

239248
void StatusEditWidget::assignUser(RamObject *u)

src/rammanagerwidgets/dbmanagerwidget.cpp

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,11 @@ void DBManagerWidget::clean()
2929
}
3030
}
3131

32-
32+
#if (QT_VERSION < QT_VERSION_CHECK(5, 15, 0))
33+
ui_reportEdit->setPlainText(report);
34+
#else
3335
ui_reportEdit->setMarkdown(report);
36+
#endif
3437
ui_cancelCleanButton->setEnabled(true);
3538
ui_acceptCleanButton->setEnabled(true);
3639
ui_cleanButton->setEnabled(false);

0 commit comments

Comments
 (0)