Skip to content

Commit

Permalink
Fix Qt compile checks
Browse files Browse the repository at this point in the history
  • Loading branch information
mbasaglia committed Dec 17, 2013
1 parent dcb8daf commit 2c4f552
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 6 deletions.
10 changes: 8 additions & 2 deletions knotter.pro
Original file line number Diff line number Diff line change
Expand Up @@ -83,17 +83,23 @@ contains(CONFIG,debug) {
#DEFINES += "BUILD_INFO=\"\\\"Knotter $$VERSION\\nBuilt on $$_DATE_\\n$${QMAKE_HOST.os} \
#$${QMAKE_HOST.version} $${QMAKE_HOST.arch}\\nQt $${QT_VERSION}\\\""\"

HAS_QT_4_8=0
HAS_QT_5=0

!lessThan(QT_MAJOR_VERSION,4) !lessThan(QT_MINOR_VERSION,8) {
DEFINES += HAS_QT_4_8
HAS_QT_4_8=1
}
greaterThan(QT_MAJOR_VERSION, 4) {
DEFINES += HAS_QT_4_8 HAS_QT_5
HAS_QT_4_8=1
HAS_QT_5=1
QT += widgets printsupport uitools
}
else {
CONFIG += uitools
}

DEFINES += "HAS_QT_4_8=$${HAS_QT_4_8}" "HAS_QT_5=$${HAS_QT_5}"

contains(CONFIG,c++11) {
DEFINES += CXX_11
}
Expand Down
2 changes: 1 addition & 1 deletion src/dialogs/export_image_dialog.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,7 @@ void Export_Image_Dialog::on_button_image_clicked()
file_name = exname;

int name_filter = filters.indexOf(export_dialog.
#ifdef HAS_QT_5
#if HAS_QT_5
selectedNameFilter
#else
selectedFilter
Expand Down
2 changes: 1 addition & 1 deletion src/dialogs/main_window.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1028,7 +1028,7 @@ void Main_Window::dropEvent(QDropEvent *event)
{
foreach ( QUrl url, event->mimeData()->urls() )
{
#ifdef HAS_QT_4_8
#if HAS_QT_4_8
if ( url.isLocalFile() )
#endif
{
Expand Down
5 changes: 3 additions & 2 deletions src/resource_manager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -295,8 +295,9 @@ Resource_Manager::~Resource_Manager()

delete script_timeout;

delete m_network_access_manager;

#if !HAS_QT_5
delete m_network_access_manager;
#endif
delete m_script_engine;
}

Expand Down

0 comments on commit 2c4f552

Please sign in to comment.