diff --git a/testhelper/helper.h b/testhelper/helper.h index c81482f..2b604de 100644 --- a/testhelper/helper.h +++ b/testhelper/helper.h @@ -4,6 +4,7 @@ #include "./global.h" #include +#include #ifndef SYNCTHINGTESTHELPER_FOR_CLI #include diff --git a/tray/gui/devbuttonsitemdelegate.cpp b/tray/gui/devbuttonsitemdelegate.cpp index a86087e..f1c0bc3 100644 --- a/tray/gui/devbuttonsitemdelegate.cpp +++ b/tray/gui/devbuttonsitemdelegate.cpp @@ -1,5 +1,7 @@ #include "./devbuttonsitemdelegate.h" +#include "./helper.h" + #include #include #include @@ -20,11 +22,6 @@ using namespace Data; namespace QtGui { -inline int centerObj(int avail, int size) -{ - return (avail - size) / 2; -} - DevButtonsItemDelegate::DevButtonsItemDelegate(QObject *parent) : QStyledItemDelegate(parent) { diff --git a/tray/gui/dirbuttonsitemdelegate.cpp b/tray/gui/dirbuttonsitemdelegate.cpp index 14478c2..03abd4c 100644 --- a/tray/gui/dirbuttonsitemdelegate.cpp +++ b/tray/gui/dirbuttonsitemdelegate.cpp @@ -1,5 +1,7 @@ #include "./dirbuttonsitemdelegate.h" +#include "./helper.h" + #include #include @@ -19,11 +21,6 @@ using namespace Data; namespace QtGui { -inline int centerObj(int avail, int size) -{ - return (avail - size) / 2; -} - DirButtonsItemDelegate::DirButtonsItemDelegate(QObject *parent) : QStyledItemDelegate(parent) { diff --git a/tray/gui/downloaditemdelegate.cpp b/tray/gui/downloaditemdelegate.cpp index a4c5bb0..4927733 100644 --- a/tray/gui/downloaditemdelegate.cpp +++ b/tray/gui/downloaditemdelegate.cpp @@ -1,5 +1,7 @@ #include "./downloaditemdelegate.h" +#include "./helper.h" + #include #include @@ -23,11 +25,6 @@ using namespace Data; namespace QtGui { -inline int centerObj(int avail, int size) -{ - return (avail - size) / 2; -} - DownloadItemDelegate::DownloadItemDelegate(QObject *parent) : QStyledItemDelegate(parent) { diff --git a/tray/gui/helper.h b/tray/gui/helper.h index 8c620cd..5cb7fd4 100644 --- a/tray/gui/helper.h +++ b/tray/gui/helper.h @@ -103,6 +103,11 @@ template inline auto triggerActionForSe }; } +inline int centerObj(int avail, int size) +{ + return (avail - size) / 2; +} + } // namespace QtGui #endif // TRAY_GUI_HELPER_H