Changeset 6443

Show
Ignore:
Timestamp:
07/10/08 02:59:50 (5 months ago)
Author:
flynd
Message:

Some fixes to make qt4-gui compile on OpenBSD.

  • Include CheckLibraryExists? module for cmake
  • Find path for boost headers as they are needed for Licq includes
  • Added some missing includes (unistd.h)
  • Cast time_t to unsigned long in sprintf to remove warnings
Location:
trunk/qt4-gui
Files:
4 modified

Legend:

Unmodified
Added
Removed
  • trunk/qt4-gui/CMakeLists.txt

    r6048 r6443  
    33include(CheckIncludeFile) 
    44include(TestCXXAcceptsFlag) 
     5include(CheckLibraryExists) 
    56 
    67set(CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR}/cmake ${CMAKE_MODULE_PATH}) 
     
    118119endif (GPGME_FOUND) 
    119120 
     121# Check for boost, used in Licq includes so we must have it 
     122find_package(Boost 1.31.1 COMPONENTS smart_ptr) 
     123link_directories ( ${Boost_LIBRARY_DIRS} ) 
     124include_directories ( ${Boost_INCLUDE_DIRS} ) 
     125set(LIBRARIES ${LIBRARIES} ${Boost_LIBRARIES}) 
    120126 
    121127# Licq headers (see cmake --help-command find_path 
  • trunk/qt4-gui/src/core/signalmanager.cpp

    r6294 r6443  
    2121#include "signalmanager.h" 
    2222 
     23#include <unistd.h> 
     24 
    2325#include <QApplication> 
    2426#include <QSocketNotifier> 
  • trunk/qt4-gui/src/dialogs/chatdlg.cpp

    r6406 r6443  
    2727#include "config.h" 
    2828 
    29 #include <ctype.h> 
    30 #include <stdlib.h> 
     29#include <cctype> 
     30#include <cstdlib> 
     31#include <unistd.h> 
    3132 
    3233#include <QActionGroup> 
  • trunk/qt4-gui/src/dialogs/filedlg.cpp

    r6048 r6443  
    214214  time_t nTime = time(NULL) - ftman->StartTime(); 
    215215  unsigned long nBytesTransfered = ftman->BytesTransfered(); 
    216   sprintf(sz, "%02ld:%02ld:%02ld", nTime / 3600, (nTime % 3600) / 60, (nTime % 60)); 
     216  sprintf(sz, "%02lu:%02lu:%02lu", (unsigned long)(nTime / 3600), (unsigned long)((nTime % 3600) / 60), (unsigned long)((nTime % 60))); 
    217217  nfoTime->setText(sz); 
    218218  if (nTime == 0 || nBytesTransfered == 0) 
     
    229229  int nBytesLeft = ftman->FileSize() - ftman->FilePos(); 
    230230  time_t nETA = (time_t)(nBytesLeft / (nBytesTransfered / nTime)); 
    231   sprintf(sz, "%02ld:%02ld:%02ld", nETA / 3600, (nETA % 3600) / 60, (nETA % 60)); 
     231  sprintf(sz, "%02lu:%02lu:%02lu", (unsigned long)(nETA / 3600), (unsigned long)((nETA % 3600) / 60), (unsigned long)((nETA % 60))); 
    232232  nfoETA->setText(sz); 
    233233