Update upstream source from tag 'upstream/0.7.1'
authorgregor herrmann <gregoa@debian.org>
Thu, 19 Aug 2021 13:58:46 +0000 (15:58 +0200)
committergregor herrmann <gregoa@debian.org>
Thu, 19 Aug 2021 13:58:46 +0000 (15:58 +0200)
Update to upstream version '0.7.1'
with Debian dir 6edf7dc8187c2f4c9a1e9cfd47b1dd7070d891b8

15 files changed:
ChangeLog
NEWS
confclerk.pro
data/confclerk.1
data/confclerk.png
src/app/app.pro
src/global.pri
src/gui/daynavigatorwidget.cpp
src/gui/daynavigatorwidget.h
src/gui/dayviewtabcontainer.cpp
src/gui/mainwindow.ui
src/mvc/delegate.cpp
src/sql/schedulexmlparser.cpp
src/sql/sqlengine.cpp
src/sql/sqlengine.h

index fd8df984f803936930699ac479ff6229b3281c18..ab9e145d9bed0ad776168b8b09ea336cbd3ee15a 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,42 @@
+2021-08-19  gregor herrmann  <gregor@toastfreeware.priv.at>
+
+       prepare NEWS before 0.7.1 release.
+
+       confclerk.pro: add --date parameter to pod2man call.
+
+       Take display time shift into account when expanding a group in the day view tab.
+
+2021-08-18  Philipp Spitzer  <philipp@spitzer.priv.at>
+
+       Fix bug: display_time_shift was lost when conference was reloaded.
+
+       Remaining fix of bug Debian BTS #992236 (line distance).
+       https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=992236
+
+       Avoid warning.
+
+       Partially fix bug Debian BTS #992236 (width of DayNavigatorWidget).
+       https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=992236
+       Could be reproduced by setting environment variable QT_FONT_DPI to 200.
+
+       Use only one line for day and date display (except MAEMO).
+
+2021-08-11  François Revol  <revol@free.fr>
+
+       Allow overriding PREFIX
+       Haiku requires a different install path.
+
+2021-08-11  François Revol  <revol@free.fr>
+
+       Fallback to uname -o for systems without /etc/issue
+       This includes Haiku.
+
+       Not necessary to build but it removes an error message.
+
 2021-07-30  gregor herrmann  <gregor@toastfreeware.priv.at>
 
+       bump version from 0.7.0 to 0.7.1 after release
+
        bump version from (unreleased) 0.6.5 to 0.7.0
        because new features (cf. 'semver')
 
diff --git a/NEWS b/NEWS
index 35d0ef957129715942d54caf238befe9aff61ca3..e22b020f5747fc548f5fb66aa6df772e9d50c122 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -1,6 +1,20 @@
 This is the NEWS file for ConfClerk. ConfClerk is the successor of
 fosdem-schedule; cf. docs/fosdem-schedule for the historic documentation.
 
+version 0.7.1, 2021-08-19
+* Build system improvements for Haiku.
+  Thanks to François Revol for the patches.
+
+* UI fixes:
+  - set minimum width in day navigator dynamically (except for Maemo)
+  - show day and date in one line (except for Maemo)
+  - adjust line heights in event lists to avoid overlaps
+  Thanks to Axel Beckert for the report in the Debian BTS #992236
+
+* Display time shift fixes:
+  - keep stored value on reloading conferences
+  - take into account for expanding time groups
+
 version 0.7.0, 2021-07-30
 * Parse, save and display UTC offset from XML files.
 * Add "display time shift" option.
index 8171399115a896841ef6b34dc6cb0fe3584a7008..ba1dea9e9af72f77617b4682cab45894b69895a3 100644 (file)
@@ -23,9 +23,10 @@ icon.target = data/$${TARGET}.png
 icon.commands = convert -transparent white data/$${TARGET}.svg data/$${TARGET}.png
 icon.depends = data/$${TARGET}.svg
 
+TODAY = $$system(date +%F)
 man.target = data/$${TARGET}.1
 man.commands = \
-       pod2man --utf8 --center=\"Offline conference scheduler\" --release=\"Version $${VERSION}\" data/$${TARGET}.pod > data/$${TARGET}.1
+       pod2man --utf8 --center=\"Offline conference scheduler\" --release=\"Version $${VERSION}\" --date \"$${TODAY}\" data/$${TARGET}.pod > data/$${TARGET}.1
 man.depends = data/$${TARGET}.pod
 
 releaseclean.commands = \
index 75144ff7cf1dd3939d488f7d401a199924b08a32..89670c119394cc2fcec471dcbeeed8989f55aafe 100644 (file)
@@ -71,7 +71,7 @@
 .\" ========================================================================
 .\"
 .IX Title "CONFCLERK 1"
-.TH CONFCLERK 1 "2021-07-29" "Version 0.7.0" "Offline conference scheduler"
+.TH CONFCLERK 1 "2021-08-19" "Version 0.7.1" "Offline conference scheduler"
 .\" For nroff, turn off justification.  Always turn off hyphenation; it makes
 .\" way too many mistakes in technical documents.
 .if n .ad l
index 5cca88eee06209c57d2c61a99bbf59778cbb35aa..d91398a58ee47c923b5fd3174871440245554926 100644 (file)
Binary files a/data/confclerk.png and b/data/confclerk.png differ
index 37f4f487137270c25e592a85d9e8118030690a99..b268734948cfd3a6ccfc0f4606f030d3d0acd568 100644 (file)
@@ -32,7 +32,9 @@ RESOURCES += ../icons.qrc \
                         ../../data/data.qrc
 
 # instalation related
-PREFIX = /usr/bin
+!defined(PREFIX, var) {
+    PREFIX = /usr/bin
+}
 INSTALLS = target
 target.path = $$PREFIX
 
index 337b841853e7de5eb8b389eae36690563df2729b..bebbbb41fae23ef25504718960b49fa5bb43043a 100644 (file)
@@ -4,12 +4,12 @@
 # USAGE: include(./global.pri)
 
 # VERSION
-VERSION = 0.7.0
+VERSION = 0.7.1
 DEFINES += VERSION=\\\"$$VERSION\\\"
 
 # Define 'MAEMO' specific CONFIG/DEFINE
 # To handle 'MAEMO' specific soruces/code
-DISTRO = $$system(cat /etc/issue)
+DISTRO = $$system(cat /etc/issue 2>/dev/null || uname -o)
 contains( DISTRO, [Mm]aemo ) {
     # for 'MAEMO' specific source code parts
     DEFINES += MAEMO
index dcda38f327f7c8284133682d2fa3acd68a2d6932..dda40a629975ba18996d2b3e3126b07b78a1c0c3 100644 (file)
@@ -83,6 +83,14 @@ void DayNavigatorWidget::unsetDates() {
     this->update();
 }
 
+QSize DayNavigatorWidget::minimumSizeHint() const {
+#ifdef MAEMO
+    return QSize(20, 0);
+#else
+    return QSize(fontMetrics().lineSpacing() * 3 / 2, 0);
+#endif
+}
+
 
 void DayNavigatorWidget::configureNavigation() {
     prevDayButton->setDisabled(!mStartDate.isValid() || mCurDate == mStartDate);
@@ -112,7 +120,13 @@ void DayNavigatorWidget::paintEvent(QPaintEvent *aEvent) {
     Q_UNUSED(aEvent);
     QString selectedDateStr;
     if (mCurDate.isValid()) {
-        selectedDateStr = mCurDate.toString("dddd\nyyyy-MM-dd");
+        QString selectedDateFormat =
+#ifdef MAEMO
+                "dddd\nyyyy-MM-dd";
+#else
+                "dddd • yyyy-MM-dd";
+#endif
+        selectedDateStr = mCurDate.toString(selectedDateFormat);
         bool hasConference = ((Application*) qApp)->hasActiveConference();
         if (hasConference) {
             Conference& conference = ((Application*) qApp)->activeConference();
@@ -120,7 +134,7 @@ void DayNavigatorWidget::paintEvent(QPaintEvent *aEvent) {
                 QTime shift(0, 0);
                 bool minus = conference.displayTimeShift() < 0;
                 shift = shift.addSecs(conference.displayTimeShift() * 60 * (minus ? -1 : 1));
-                selectedDateStr += " (" + (minus ? QString("-") : "+") + shift.toString("HH:mm") + ")";
+                selectedDateStr += " • " + (minus ? QString("-") : "+") + shift.toString("HH:mm");
             }
         }
     } else {
index c89360556e08116350a18db8169d5197ec4d7cb7..92779624e5198b57eb335a5a047ab92ff26b344d 100644 (file)
@@ -38,8 +38,9 @@ class DayNavigatorWidget : public QWidget, private Ui::DayNavigatorWidget {
         QDate curDate() const {return mCurDate;}
         QDate endDate() const {return mEndDate;}
         void unsetDates();
+        virtual QSize minimumSizeHint() const override;
     protected:
-        void paintEvent(QPaintEvent *);
+        virtual void paintEvent(QPaintEvent *) override;
         void configureNavigation();
     private slots:
         void prevDayButtonClicked();
index 8b067164fee321dfc0a0cf0f67e70de9f760a184..5427fd88f569955c75fc97223c37d83496416ce9 100644 (file)
@@ -26,6 +26,7 @@ DayViewTabContainer::DayViewTabContainer(QWidget *aParent): TabContainer(aParent
 
 void DayViewTabContainer::expandTimeGroup(QTime time, int conferenceId) {
     EventModel* eventModel = static_cast<EventModel*>(treeView->model());
+    Conference conference = Conference::getById(conferenceId);
 
     // iterate over the time groups
     for (int g = 0; g != eventModel->rowCount(); ++g) {
@@ -35,7 +36,9 @@ void DayViewTabContainer::expandTimeGroup(QTime time, int conferenceId) {
             QModelIndex eventIdx = eventModel->index(e, 0, groupIdx);
             int eventId = eventIdx.data().toInt();
             Event event = Event::getById(eventId, conferenceId);
-            if (time < event.start().time().addSecs(event.duration())) { // if time < end
+            QDateTime eventStart = event.start();
+            if (conference.hasDisplayTimeShift()) eventStart = eventStart.addSecs(conference.displayTimeShift() * 60);
+            if (time < eventStart.time().addSecs(event.duration())) { // if time < end
                 // expand this group
                 treeView->expand(groupIdx);
                 treeView->scrollTo(eventIdx, QAbstractItemView::PositionAtTop);
index e3b4fa1b2a4690f956409377c086d8fbb7ad9d63..d866c4d2d290ef972c776d4d62e729627a7e74de 100644 (file)
   <widget class="QWidget" name="centralwidget">
    <layout class="QHBoxLayout" name="horizontalLayout">
     <item>
-     <widget class="DayNavigatorWidget" name="dayNavigator" native="true">
-      <property name="minimumSize">
-       <size>
-        <width>20</width>
-        <height>0</height>
-       </size>
-      </property>
-     </widget>
+     <widget class="DayNavigatorWidget" name="dayNavigator" native="true"/>
     </item>
     <item>
      <widget class="QTabWidget" name="tabWidget">
index 55bf4c88f10831188f2ad67f51e084371550b306..889f87b772ed79efa68b303664911009085045e0 100644 (file)
@@ -88,6 +88,7 @@ void Delegate::paint(QPainter *painter, const QStyleOptionViewItem &option, cons
         fontSmall.setBold(false);
         fontSmall.setPixelSize(aux*0.2);
         QFontMetrics fmSmall(fontSmall);
+
         // font SMALL bold
         QFont fontSmallB = fontSmall;
         fontSmallB.setBold(true);
@@ -151,10 +152,10 @@ void Delegate::paint(QPainter *painter, const QStyleOptionViewItem &option, cons
         Conference& conference = ((Application*) qApp)->activeConference();
         QTime start = conference.shiftTime(event->start().time());
         painter->setFont(fontBig);
-        painter->drawText(titlePointF,start.toString("hh:mm") + "-" + start.addSecs(event->duration()).toString("hh:mm") + ", " + event->roomName());
+        painter->drawText(titlePointF, start.toString("hh:mm") + "-" + start.addSecs(event->duration()).toString("hh:mm") + ", " + event->roomName());
 
         // title
-        titlePointF.setY(titlePointF.y()+fmBig.height()-fmBig.descent());
+        titlePointF.setY(titlePointF.y() + fmBig.lineSpacing());
         painter->setFont(fontBigB);
         QString title = event->title();
         if(fmBigB.boundingRect(title).width() > (option.rect.width()-2*SPACER)) // the title won't fit the screen
@@ -171,17 +172,17 @@ void Delegate::paint(QPainter *painter, const QStyleOptionViewItem &option, cons
             }
             title += "...";
         }
-        painter->drawText(titlePointF,title);
+        painter->drawText(titlePointF, title);
 
         // persons
-        titlePointF.setY(titlePointF.y()+fmSmall.height()-fmSmall.descent());
+        titlePointF.setY(titlePointF.y() + fmBigB.descent() + fmSmall.lineSpacing());
         painter->setFont(fontSmall);
         QString presenterPrefix = event->persons().count() < 2 ? "Presenter" : "Presenters";
-        painter->drawText(titlePointF,presenterPrefix + ": " + event->persons().join(" and "));
+        painter->drawText(titlePointF, presenterPrefix + ": " + event->persons().join(" and "));
 
         // track
-        titlePointF.setY(titlePointF.y()+fmSmall.height()-fmSmall.descent());
-        painter->drawText(titlePointF,"Track: " + Track::retrieveTrackName(event->trackId()));
+        titlePointF.setY(titlePointF.y() + fmSmall.lineSpacing());
+        painter->drawText(titlePointF, "Track: " + Track::retrieveTrackName(event->trackId()));
     }
 
     else // doesn't have parent - time-groups' elements (top items)
index 8cddd3d7abb3a446311e3c33a72237df6bc0a93f..64e266dbec34f4ddba26842a636a703a5e20001c 100644 (file)
@@ -84,7 +84,7 @@ void ScheduleXmlParser::parseDataImpl(const QByteArray &aData, const QString& ur
             conference["utc_offset"] = QString();
             conference["display_time_shift"] = QString();
             conference["url"] = url;
-            sqlEngine->addConferenceToDB(conference, conferenceId);
+            sqlEngine->addConferenceToDB(conference, conferenceId, conferenceId != 0);
             conferenceId = conference["id"].toInt();
             conference_title = conference["title"];
             conference_day_change = QTime(0, 0).addSecs(conference["day_change"].toInt());
@@ -192,7 +192,7 @@ void ScheduleXmlParser::parseDataImpl(const QByteArray &aData, const QString& ur
 
         // Re-write conference as utc_offset was not known previously
         if (!conference.value("utc_offset").isEmpty()) {
-            sqlEngine->addConferenceToDB(conference, conferenceId);
+            sqlEngine->addConferenceToDB(conference, conferenceId, conferenceId != 0);
         }
 
     } // schedule element
index 9a5bdb1ca311add9bc3d481da1fc0304357a4577..74c5cd7d3a4926b39f89feb6428e1c2612a22665 100644 (file)
@@ -144,7 +144,7 @@ bool SqlEngine::applySqlFile(const QString sqlFile) {
 }
 
 
-void SqlEngine::addConferenceToDB(QHash<QString,QString> &aConference, int conferenceId) {
+void SqlEngine::addConferenceToDB(QHash<QString,QString> &aConference, int conferenceId, bool omit_display_time_shift) {
     QSqlQuery query(db);
     bool insert = conferenceId <= 0;
     if (insert) { // insert conference
@@ -153,9 +153,11 @@ void SqlEngine::addConferenceToDB(QHash<QString,QString> &aConference, int confe
                         " VALUES (:title,:url,:subtitle,:venue,:city,:start,:end,"
                                                 ":day_change,:timeslot_duration,:utc_offset,:display_time_shift,:active)");
     } else { // update conference
-        query.prepare("UPDATE CONFERENCE set title=:title, url=:url, subtitle=:subtitle, venue=:venue, city=:city, start=:start, end=:end,"
-                                            "day_change=:day_change, timeslot_duration=:timeslot_duration, utc_offset=:utc_offset, display_time_shift=:display_time_shift, active=:active "
-                      "WHERE id=:id");
+        QString update = "UPDATE CONFERENCE set title=:title, url=:url, subtitle=:subtitle, venue=:venue, city=:city, start=:start, end=:end, "
+                         "day_change=:day_change, timeslot_duration=:timeslot_duration, utc_offset=:utc_offset";
+        if (!omit_display_time_shift) update += ", display_time_shift=:display_time_shift";
+        update += ", active=:active WHERE id=:id";
+        query.prepare(update);
     }
     foreach (QString prop_name, (QList<QString>() << "title" << "url" << "subtitle" << "venue" << "city")) {
         query.bindValue(QString(":") + prop_name, aConference[prop_name]);
@@ -168,9 +170,11 @@ void SqlEngine::addConferenceToDB(QHash<QString,QString> &aConference, int confe
     QVariant utc_offset;
     if (!aConference.value("utc_offset").isEmpty()) utc_offset = aConference["utc_offset"].toInt();
     query.bindValue(":utc_offset", utc_offset);
-    QVariant display_time_shift;
-    if (!aConference.value("display_time_shift").isEmpty()) display_time_shift = aConference["display_time_shift"].toInt();
-    query.bindValue(":display_time_shift", display_time_shift);
+    if (!omit_display_time_shift) {
+        QVariant display_time_shift;
+        if (!aConference.value("display_time_shift").isEmpty()) display_time_shift = aConference["display_time_shift"].toInt();
+        query.bindValue(":display_time_shift", display_time_shift);
+    }
     query.bindValue(":active", 1);
     if (!insert) query.bindValue(":id", conferenceId);
     query.exec();
index 0a964bf599c553517cc1503e43dea9901283bb58..85ace9780dc53a96727003b89daced81b7bee878 100644 (file)
@@ -59,8 +59,8 @@ class SqlEngine : public QObject {
         /// Applies an SQL file
         bool applySqlFile(const QString sqlFile);
 
-        // if a conferneceId != 0 is given, the confernce is updated instead of inserted.
-        void addConferenceToDB(QHash<QString,QString> &aConference, int conferenceId);
+        // if a conferenceId != 0 is given, the conference is updated instead of inserted.
+        void addConferenceToDB(QHash<QString,QString> &aConference, int conferenceId, bool omit_display_time_shift = false);
         void addEventToDB(QHash<QString,QString> &aEvent);
         void addPersonToDB(QHash<QString,QString> &aPerson);
         void addLinkToDB(QHash<QString,QString> &aLink);