Skip to content

Commit

Permalink
fix warnings - prepare for release
Browse files Browse the repository at this point in the history
  • Loading branch information
Lyubomir Filipov committed Jan 22, 2023
1 parent 4658279 commit 536efa2
Show file tree
Hide file tree
Showing 8 changed files with 24 additions and 11 deletions.
2 changes: 1 addition & 1 deletion .version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
1.1
1.2
5 changes: 5 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,11 @@ else()
${SOURCES}
resource.qrc
)

if (${CMAKE_SYSTEM_NAME} STREQUAL "Windows")
set_property(TARGET qmattermost PROPERTY WIN32_EXECUTABLE true)
endif()

endif()

add_subdirectory (tools)
Expand Down
4 changes: 4 additions & 0 deletions sources/backend/HTTPConnector.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,11 @@ void HTTPConnector::setProcessReply (QNetworkReply* reply, std::function<void (Q
}
});

#if QT_VERSION <= QT_VERSION_CHECK(5,15,0)
connect(reply, qOverload<QNetworkReply::NetworkError>(&QNetworkReply::error),
#else
connect(reply, qOverload<QNetworkReply::NetworkError>(&QNetworkReply::errorOccurred),
#endif
this, [this, reply](QNetworkReply::NetworkError error) {

emit onNetworkError (error, reply->errorString());
Expand Down
4 changes: 2 additions & 2 deletions sources/backend/types/BackendPost.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,8 @@
namespace Mattermost {

BackendPost::BackendPost (const QJsonObject& jsonObject, const Storage& storage)
:author (nullptr)
,rootPost (nullptr)
:rootPost (nullptr)
,author (nullptr)
,isDeleted (false)
{
id = jsonObject.value("id").toString();
Expand Down
8 changes: 6 additions & 2 deletions sources/channel-tree/ChannelItemWidget.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,13 @@ ChannelItemWidget::~ChannelItemWidget()
delete ui;
}

const QPixmap* ChannelItemWidget::getPixmap () const
const QPixmap ChannelItemWidget::getPixmap () const
{
return ui->icon->pixmap();
#if QT_VERSION <= QT_VERSION_CHECK(5,15,0)
return ui->icon->pixmap () ? *ui->icon->pixmap () : QPixmap();
#else
return ui->icon->pixmap (Qt::ReturnByValue);
#endif
}

void ChannelItemWidget::setIcon (const QIcon& icon)
Expand Down
2 changes: 1 addition & 1 deletion sources/channel-tree/ChannelItemWidget.h
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ class ChannelItemWidget: public QWidget
explicit ChannelItemWidget(QWidget *parent = nullptr);
~ChannelItemWidget();

const QPixmap* getPixmap () const;
const QPixmap getPixmap () const;
void setIcon (const QIcon &icon);
void setLabel (const QString& label);

Expand Down
4 changes: 2 additions & 2 deletions sources/chat-area/ChatArea.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -386,8 +386,8 @@ void ChatArea::moveOnListTop ()
ChannelItemWidget* newItemWidget = new ChannelItemWidget (thisItemWidget->parentWidget());
newItemWidget->setLabel (channel.display_name);

if (thisItemWidget->getPixmap()) {
newItemWidget->setIcon (QIcon(*thisItemWidget->getPixmap()));
if (!thisItemWidget->getPixmap().isNull()) {
newItemWidget->setIcon (QIcon(thisItemWidget->getPixmap()));
}

qDebug() << "Move on top (" << parent->indexOfChild(treeItem) << ") -> 0";
Expand Down
6 changes: 3 additions & 3 deletions sources/chat-area/post-separator/PostDaySeparatorWidget.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -72,8 +72,8 @@ PostDaySeparatorWidget::PostDaySeparatorWidget (uint32_t daysAgo)

PostDaySeparatorWidget::~PostDaySeparatorWidget () = default;

//date.endOfDay() was introduced in QT 14
#if QT_VERSION_MAJOR == 5 && QT_VERSION_MINOR < 14
//date.endOfDay() was introduced in QT 5.14
#if QT_VERSION <= QT_VERSION_CHECK(5,14,0)
static QDateTime endOfDay (QDateTime now)
{
QDateTime when (now.date(), QTime(23, 59, 59, 999));
Expand All @@ -88,7 +88,7 @@ int PostDaySeparatorWidget::getMsToEndOfTheDay ()
QDateTime now = QDateTime::currentDateTime();

//date.endOfDay() was introduced in QT 14
#if QT_VERSION_MAJOR == 5 && QT_VERSION_MINOR < 14
#if QT_VERSION <= QT_VERSION_CHECK(5,14,0)
QDateTime end = endOfDay ();
#else
QDateTime end = now.date().endOfDay ();
Expand Down

0 comments on commit 536efa2

Please sign in to comment.