Ticket #44526: patch-use-qt5.diff

File patch-use-qt5.diff, 32.1 KB (added by RJVB (René Bertin), 10 years ago)
  • src/accelUtil.cpp

    diff -r b193168bad98 src/accelUtil.cpp
     
    2727#include <accelUtil.h>
    2828#include <resources.h>
    2929
    30 #include <QtGui/QKeySequence>
     30#include <QKeySequence>
    3131
    3232#include <iostream>
    3333#include <string.h>
     
    4949   QString cval = val.trimmed().toLower();
    5050
    5151   QKeySequence keyseq = QKeySequence::fromString( cval );
    52    accel = (int)keyseq;
     52   accel = keyseq[0];
    5353   
    5454   // Check that converting back gets the original value
    5555   return ( cval == keyseq.toString().toLower() );
     
    5959//
    6060void XxAccelUtil::write( std::ostream& os, int accel )
    6161{
    62    os << QKeySequence( accel ).toString().toAscii().constData();
     62   os << QKeySequence( accel ).toString().toLatin1().constData();
    6363}
    6464
    6565XX_NAMESPACE_END
  • src/accelUtil.h

    diff -r b193168bad98 src/accelUtil.h
     
    3232#endif
    3333
    3434#ifndef INCL_QT_QSTRING
    35 #include <QtCore/QString>
     35#include <QString>
    3636#define INCL_QT_QSTRING
    3737#endif
    3838
  • src/app.cpp

    diff -r b193168bad98 src/app.cpp
     
    4949#include <central.h>
    5050#include <borderLabel.h>
    5151
    52 #include <QtGui/QMainWindow>
    53 #include <QtGui/QMenu>
    54 #include <QtGui/QMenuBar>
    55 #include <QtGui/QLayout>
    56 #include <QtGui/QScrollBar>
    57 #include <QtGui/QLabel>
    58 #include <QtGui/QStyleFactory>
    59 #include <QtGui/QFont>
    60 #include <QtGui/QMessageBox>
    61 #include <QtGui/QFileDialog>
    62 #include <QtGui/QShortcut>
    63 #include <QtGui/QWhatsThis>
    64 #include <QtGui/QClipboard>
    65 #include <QtCore/QProcess>
    66 #include <QtGui/QToolBar>
    67 #include <QtGui/QAction>
    68 #include <QtCore/QTextStream>
    69 #include <QtCore/QFile>
    70 #include <QtGui/QSplitter>
    71 #include <QtCore/QRegExp>
    72 #include <QtGui/QCheckBox>
    73 #include <QtCore/QDateTime>
    74 #include <QtGui/QPixmap>
    75 #include <QtGui/QHBoxLayout>
    76 #include <QtGui/QVBoxLayout>
     52#include <QMainWindow>
     53#include <QMenu>
     54#include <QMenuBar>
     55#include <QLayout>
     56#include <QScrollBar>
     57#include <QLabel>
     58#include <QStyleFactory>
     59#include <QFont>
     60#include <QMessageBox>
     61#include <QFileDialog>
     62#include <QShortcut>
     63#include <QWhatsThis>
     64#include <QClipboard>
     65#include <QProcess>
     66#include <QToolBar>
     67#include <QAction>
     68#include <QTextStream>
     69#include <QFile>
     70#include <QSplitter>
     71#include <QRegExp>
     72#include <QCheckBox>
     73#include <QDateTime>
     74#include <QPixmap>
     75#include <QHBoxLayout>
     76#include <QVBoxLayout>
    7777
    7878
    7979#ifdef XX_KDE
     
    179179   XxMainWindow(
    180180      XxApp*      app,
    181181      QWidget*    parent = 0,
    182       Qt::WFlags      f = Qt::Window
     182      Qt::WindowFlags      f = Qt::Window
    183183   );
    184184
    185185
     
    197197XxMainWindow::XxMainWindow(
    198198   XxApp*      app,
    199199   QWidget*    parent,
    200    Qt::WFlags      f
     200   Qt::WindowFlags      f
    201201) :
    202202   QkMainWindow( parent, f ),
    203203   _app( app )
     
    22832283         if ( _resources->getBoolOpt( BOOL_DIRDIFF_RECURSIVE ) ) {
    22842284            dirdiff_command = _resources->getCommand(
    22852285               CMD_DIFF_DIRECTORIES_REC
    2286             ).toAscii();
     2286            ).toLatin1();
    22872287         }
    22882288         else {
    22892289            dirdiff_command = _resources->getCommand(
    22902290               CMD_DIFF_DIRECTORIES
    2291             ).toAscii();
     2291            ).toLatin1();
    22922292         }
    22932293         std::auto_ptr<XxDiffs> tmp(
    22942294            dirsBuilder->process( dirdiff_command.constData(), *_files[0], *_files[1] )
     
    35473547
    35483548   if ( filenames.count() > 0 ) {
    35493549      // Spawn a diff.
    3550       QString command = argv()[0];
     3550      QString command = arguments()[0];
    35513551
    35523552      if ( filenames.count() == 1 ) {
    35533553         command += QString(" --single ");
  • src/app.h

    diff -r b193168bad98 src/app.h
     
    4848#endif
    4949
    5050#ifndef INCL_QT_QAPPLICATION
    51 #include <QtGui/QApplication>
     51#include <QApplication>
    5252#define INCL_QT_QAPPLICATION
    5353#endif
    5454
    5555#ifndef INCL_QT_QFILEINFO
    56 #include <QtCore/QFileInfo>
     56#include <QFileInfo>
    5757#define INCL_QT_QFILEINFO
    5858#endif
    5959
  • src/app.inline.h

    diff -r b193168bad98 src/app.inline.h
     
    3737#endif
    3838
    3939#ifndef INCL_QT_QSCROLLBAR
    40 #include <QtGui/QScrollBar>
     40#include <QScrollBar>
    4141#define INCL_QT_QSCROLLBAR
    4242#endif
    4343
  • src/borderLabel.cpp

    diff -r b193168bad98 src/borderLabel.cpp
     
    2727#include <borderLabel.h>
    2828#include <app.h>
    2929
    30 #include <QtGui/QPainter>
    31 #include <QtGui/QBrush>
    32 #include <QtGui/QPen>
    33 #include <QtGui/QColor>
     30#include <QPainter>
     31#include <QBrush>
     32#include <QPen>
     33#include <QColor>
    3434
    35 #include <QtGui/QApplication>
    36 #include <QtGui/QLabel>
     35#include <QApplication>
     36#include <QLabel>
    3737
    3838#include <stdio.h>
    3939
  • src/borderLabel.h

    diff -r b193168bad98 src/borderLabel.h
     
    3636#endif
    3737
    3838#ifndef INCL_QT_QLABEL
    39 #include <QtGui/QLabel>
     39#include <QLabel>
    4040#define INCL_QT_QLABEL
    4141#endif
    4242
  • src/buffer.cpp

    diff -r b193168bad98 src/buffer.cpp
     
    2828#include <exceptions.h>
    2929#include <util.h>
    3030
    31 #include <QtGui/QFontMetrics>
    32 #include <QtGui/QFont>
    33 #include <QtCore/QRect>
    34 #include <QtCore/QDir>
     31#include <QFontMetrics>
     32#include <QFont>
     33#include <QRect>
     34#include <QDir>
    3535
    3636#include <iostream>
    3737#include <string.h>
  • src/buffer.h

    diff -r b193168bad98 src/buffer.h
     
    5151#endif
    5252
    5353#ifndef INCL_QT_QSTRING
    54 #include <QtCore/QString>
     54#include <QString>
    5555#define INCL_QT_QSTRING
    5656#endif
    5757
    5858#ifndef INCL_QT_QSTRINGLIST
    59 #include <QtCore/QStringList>
     59#include <QStringList>
    6060#define INCL_QT_QSTRINGLIST
    6161#endif
    6262
    6363#ifndef INCL_QT_QFILEINFO
    64 #include <QtCore/QFileInfo>
     64#include <QFileInfo>
    6565#define INCL_QT_QFILEINFO
    6666#endif
    6767
  • src/builderDirs2.cpp

    diff -r b193168bad98 src/builderDirs2.cpp
     
    3030#include <util.h>
    3131#include <buffer.h>
    3232
    33 #include <QtCore/QString>
    34 #include <QtCore/QByteArray>
    35 #include <QtCore/QStringList>
    36 #include <QtCore/QTextStream>
    37 #include <QtCore/QFile>
    38 #include <QtCore/QProcess>
     33#include <QString>
     34#include <QByteArray>
     35#include <QStringList>
     36#include <QTextStream>
     37#include <QFile>
     38#include <QProcess>
    3939
    4040#include <stdexcept>
    4141#include <stdio.h>
  • src/builderFiles2.cpp

    diff -r b193168bad98 src/builderFiles2.cpp
     
    3131#include <diffutils.h>
    3232#include <buffer.h>
    3333
    34 #include <QtCore/QString>
    35 #include <QtCore/QByteArray>
    36 #include <QtCore/QTextStream>
    37 #include <QtCore/QFile>
    38 #include <QtCore/QProcess>
     34#include <QString>
     35#include <QByteArray>
     36#include <QTextStream>
     37#include <QFile>
     38#include <QProcess>
    3939
    4040#include <stdexcept>
    4141#include <stdio.h>
  • src/builderFiles3.cpp

    diff -r b193168bad98 src/builderFiles3.cpp
     
    3030#include <util.h>
    3131#include <buffer.h>
    3232
    33 #include <QtCore/QString>
    34 #include <QtCore/QByteArray>
    35 #include <QtCore/QTextStream>
    36 #include <QtCore/QFile>
    37 #include <QtCore/QProcess>
     33#include <QString>
     34#include <QByteArray>
     35#include <QTextStream>
     36#include <QFile>
     37#include <QProcess>
    3838
    3939#include <stdexcept>
    4040#include <stdio.h>
  • src/builderSingle.cpp

    diff -r b193168bad98 src/builderSingle.cpp
     
    2828#include <diffs.h>
    2929#include <buffer.h>
    3030
    31 #include <QtCore/QTextStream>
     31#include <QTextStream>
    3232
    3333#include <stdio.h>
    3434#include <iostream>
  • src/builderUnmerge.cpp

    diff -r b193168bad98 src/builderUnmerge.cpp
     
    2929#include <buffer.h>
    3030#include <resources.h>
    3131
    32 #include <QtCore/QByteArray>
    33 #include <QtCore/QTextStream>
    34 #include <QtCore/QRegExp>
     32#include <QByteArray>
     33#include <QTextStream>
     34#include <QRegExp>
    3535
    3636#include <stdio.h>
    3737#include <iostream>
  • src/central.cpp

    diff -r b193168bad98 src/central.cpp
     
    3535#include <borderLabel.h>
    3636#include <help.h>
    3737
    38 #include <QtGui/QPainter>
    39 #include <QtGui/QBrush>
    40 #include <QtGui/QPen>
    41 #include <QtGui/QColor>
    42 #include <QtGui/QLayout>
    43 #include <QtGui/QShortcut>
     38#include <QPainter>
     39#include <QBrush>
     40#include <QPen>
     41#include <QColor>
     42#include <QLayout>
     43#include <QShortcut>
    4444
    45 #include <QtGui/QApplication>
    46 #include <QtGui/QClipboard>
    47 #include <QtGui/QHBoxLayout>
    48 #include <QtGui/QFrame>
    49 #include <QtGui/QLabel>
    50 #include <QtGui/QVBoxLayout>
     45#include <QApplication>
     46#include <QClipboard>
     47#include <QHBoxLayout>
     48#include <QFrame>
     49#include <QLabel>
     50#include <QVBoxLayout>
    5151
    5252#include <math.h>
    5353#include <stdio.h>
  • src/central.h

    diff -r b193168bad98 src/central.h
     
    4040#endif
    4141
    4242#ifndef INCL_QT_QMAINWINDOW
    43 #include <QtGui/QMainWindow>
     43#include <QMainWindow>
    4444#define INCL_QT_QMAINWINDOW
    4545#endif
    4646
    4747#ifndef INCL_QT_QFRAME
    48 #include <QtGui/QFrame>
     48#include <QFrame>
    4949#define INCL_QT_QFRAME
    5050#endif
    5151
  • src/cmdline.cpp

    diff -r b193168bad98 src/cmdline.cpp
     
    3636
    3737#include <kdeSupport.h>
    3838
    39 #include <QtGui/QApplication>
    40 #include <QtCore/QByteArray>
    41 #include <QtCore/QTextStream>
     39#include <QApplication>
     40#include <QByteArray>
     41#include <QTextStream>
    4242
    4343/*#define getopt xxdiff_getopt*/
    4444#include <getopt.h>
  • src/copyLabel.cpp

    diff -r b193168bad98 src/copyLabel.cpp
     
    2828
    2929#include <kdeSupport.h>
    3030
    31 #include <QtGui/QToolTip>
     31#include <QToolTip>
    3232
    33 #include <QtGui/QApplication>
    34 #include <QtGui/QClipboard>
    35 #include <QtGui/QResizeEvent>
    36 #include <QtGui/QMouseEvent>
    37 #include <QtGui/QLabel>
     33#include <QApplication>
     34#include <QClipboard>
     35#include <QResizeEvent>
     36#include <QMouseEvent>
     37#include <QLabel>
    3838
    3939
    4040/*==============================================================================
  • src/copyLabel.h

    diff -r b193168bad98 src/copyLabel.h
     
    3636#endif
    3737
    3838#ifndef INCL_QT_QLABEL
    39 #include <QtGui/QLabel>
     39#include <QLabel>
    4040#define INCL_QT_QLABEL
    4141#endif
    4242
  • src/diffs.cpp

    diff -r b193168bad98 src/diffs.cpp
     
    2828#include <buffer.h>
    2929#include <resources.h>
    3030
    31 #include <QtCore/QTextStream>
     31#include <QTextStream>
    3232
    3333#include <list>
    3434#include <algorithm>
  • src/diffs.h

    diff -r b193168bad98 src/diffs.h
     
    4040#endif
    4141
    4242#ifndef INCL_QT_QOBJECT
    43 #include <QtCore/QObject>
     43#include <QObject>
    4444#define INCL_QT_QOBJECT
    4545#endif
    4646
  • src/diffutils.h

    diff -r b193168bad98 src/diffutils.h
     
    3232#endif
    3333
    3434#ifndef INCL_QT_QSTRING
    35 #include <QtCore/QString>
     35#include <QString>
    3636#define INCL_QT_QSTRING
    3737#endif
    3838
  • src/exceptions.cpp

    diff -r b193168bad98 src/exceptions.cpp
     
    2828#include <cmdline.h>
    2929#include <help.h>
    3030
    31 #include <QtCore/QTextStream>
     31#include <QTextStream>
    3232
    3333#include <iostream>
    3434#include <string.h> // strerror
  • src/exceptions.h

    diff -r b193168bad98 src/exceptions.h
     
    3333#endif
    3434
    3535#ifndef INCL_QT_QSTRING
    36 #include <QtCore/QString>
     36#include <QString>
    3737#define INCL_QT_QSTRING
    3838#endif
    3939
    4040#ifndef INCL_QT_QTEXTSTREAM
    41 #include <QtCore/QTextStream>
     41#include <QTextStream>
    4242#define INCL_QT_QTEXTSTREAM
    4343#endif
    4444
  • src/help.cpp

    diff -r b193168bad98 src/help.cpp
     
    3232#include <resParser.h>
    3333
    3434#include <kdeSupport.h>
    35 #include <QtGui/QPixmap>
    36 #include <QtCore/QTextStream>
    37 #include <QtGui/QVBoxLayout>
     35#include <QPixmap>
     36#include <QTextStream>
     37#include <QVBoxLayout>
    3838
    3939namespace XX_NAMESPACE_PREFIX { namespace Manual {
    4040#if !defined(WINDOWS) && !defined(__APPLE__) && !defined(__CYGWIN__)
     
    4444#endif
    4545}}
    4646
    47 #include <QtGui/QDialog>
    48 #include <QtGui/QMessageBox>
    49 #include <QtGui/QLayout>
    50 #include <QtGui/QLabel>
    51 #include <QtGui/QPushButton>
    52 #include <QtGui/QPalette>
    53 #include <QtGui/QTextBrowser>
    54 #include <QtCore/QByteArray>
    55 #include <QtGui/QLineEdit>
     47#include <QDialog>
     48#include <QMessageBox>
     49#include <QLayout>
     50#include <QLabel>
     51#include <QPushButton>
     52#include <QPalette>
     53#include <QTextBrowser>
     54#include <QByteArray>
     55#include <QLineEdit>
    5656
    5757#include <iostream>
    5858#include <stdio.h>
  • src/help.h

    diff -r b193168bad98 src/help.h
     
    3636#endif
    3737
    3838#ifndef INCL_QT_QDIALOG
    39 #include <QtGui/QDialog>
     39#include <QDialog>
    4040#define INCL_QT_QDIALOG
    4141#endif
    4242
  • src/hordiffImp.cpp

    diff -r b193168bad98 src/hordiffImp.cpp
     
    2727#include <hordiffImp.h>
    2828#include <resources.h>
    2929
    30 #include <QtCore/QByteArray>
     30#include <QByteArray>
    3131
    3232#ifndef COMPILER_MIPSPRO
    3333#include <cctype> // isspace()
  • src/line.h

    diff -r b193168bad98 src/line.h
     
    4141#endif
    4242
    4343#ifndef INCL_QT_QSTRING
    44 #include <QtCore/QString>
     44#include <QString>
    4545#define INCL_QT_QSTRING
    4646#endif
    4747
  • src/lineNumbers.cpp

    diff -r b193168bad98 src/lineNumbers.cpp
     
    3232#include <buffer.h>
    3333#include <text.h>
    3434
    35 #include <QtGui/QPainter>
    36 #include <QtGui/QBrush>
    37 #include <QtGui/QPen>
    38 #include <QtGui/QColor>
     35#include <QPainter>
     36#include <QBrush>
     37#include <QPen>
     38#include <QColor>
    3939
    40 #include <QtGui/QApplication>
    41 #include <QtGui/QClipboard>
    42 #include <QtGui/QFrame>
     40#include <QApplication>
     41#include <QClipboard>
     42#include <QFrame>
    4343
    4444#include <math.h>
    4545#include <stdio.h>
  • src/lineNumbers.h

    diff -r b193168bad98 src/lineNumbers.h
     
    3636#endif
    3737
    3838#ifndef INCL_QT_QFRAME
    39 #include <QtGui/QFrame>
     39#include <QFrame>
    4040#define INCL_QT_QFRAME
    4141#endif
    4242
  • src/main.cpp

    diff -r b193168bad98 src/main.cpp
     
    9191      }
    9292   }
    9393   catch ( const XxError& ex ) {
    94       std::cerr << ex.getMsg().toAscii().constData() << std::endl;
     94      std::cerr << ex.getMsg().toLatin1().constData() << std::endl;
    9595      // Note: we're casting for Windows MSVC streams which are broken.
    9696   }
    9797   catch ( const std::exception& ex ) {
  • src/markers.cpp

    diff -r b193168bad98 src/markers.cpp
     
    2626
    2727#include <markers.h>
    2828
    29 #include <QtGui/QFileDialog>
    30 #include <QtCore/QFileInfo>
    31 #include <QtCore/QString>
    32 #include <QtCore/QDir>
     29#include <QFileDialog>
     30#include <QFileInfo>
     31#include <QString>
     32#include <QDir>
    3333
    34 #include <QtGui/QRadioButton>
    35 #include <QtGui/QLineEdit>
    36 #include <QtGui/QLabel>
    37 #include <QtGui/QCheckBox>
     34#include <QRadioButton>
     35#include <QLineEdit>
     36#include <QLabel>
     37#include <QCheckBox>
    3838
    39 #include <QtGui/QLayout>
    40 #include <QtGui/QPushButton>
    41 #include <QtGui/QHBoxLayout>
    42 #include <QtGui/QVBoxLayout>
     39#include <QLayout>
     40#include <QPushButton>
     41#include <QHBoxLayout>
     42#include <QVBoxLayout>
    4343
    4444XX_NAMESPACE_BEGIN
    4545
     
    167167
    168168   _buttonOk = new QPushButton;
    169169   _buttonOk->setText( trUtf8( "Ok" ) );
    170    _buttonOk->setDefault( TRUE );
     170   _buttonOk->setDefault( true );
    171171   hlayout->addWidget( _buttonOk );
    172172   hlayout->addItem( new QSpacerItem( 20, 20, QSizePolicy::Expanding, QSizePolicy::Minimum ) );
    173173
     
    253253   
    254254   // Hack to embed XxMarkersWidget into the QFileDialog, since the
    255255   // convenient Qt3 addWidgets doesn't exist anymore
    256    QVBoxLayout *l = qFindChild<QVBoxLayout*>(this);
     256   QVBoxLayout *l = this->findChild<QVBoxLayout*>(); //qFindChild<QVBoxLayout*>(this);
    257257   Q_ASSERT(l);
    258258   _markersWidget = new XxMarkersWidget( threeWay );
    259259   l->addWidget(_markersWidget);
     
    272272)
    273273{
    274274   XxMarkersFileDialog* dlg = new XxMarkersFileDialog(
    275       startWith, filter, TRUE, threeWay, parent
     275      startWith, filter, true, threeWay, parent
    276276   );
    277277
    278278   QString result;
  • src/markers.h

    diff -r b193168bad98 src/markers.h
     
    3737#endif
    3838
    3939#ifndef INCL_STD_QFILEDIALOG
    40 #include <QtGui/QFileDialog>
     40#include <QFileDialog>
    4141#define INCL_STD_QFILEDIALOG
    4242#endif
    4343
  • src/merged.cpp

    diff -r b193168bad98 src/merged.cpp
     
    3131#include <diffs.h>
    3232#include <buffer.h>
    3333
    34 #include <QtGui/QPainter>
    35 #include <QtGui/QBrush>
    36 #include <QtGui/QPen>
    37 #include <QtGui/QColor>
    38 #include <QtGui/QMenu>
    39 #include <QtGui/QMenuBar>
    40 #include <QtGui/QLayout>
    41 #include <QtGui/QCloseEvent>
     34#include <QPainter>
     35#include <QBrush>
     36#include <QPen>
     37#include <QColor>
     38#include <QMenu>
     39#include <QMenuBar>
     40#include <QLayout>
     41#include <QCloseEvent>
    4242
    43 #include <QtGui/QApplication>
    44 #include <QtGui/QClipboard>
    45 #include <QtGui/QHBoxLayout>
    46 #include <QtGui/QVBoxLayout>
     43#include <QApplication>
     44#include <QClipboard>
     45#include <QHBoxLayout>
     46#include <QVBoxLayout>
    4747
    4848#include <math.h>
    4949#include <stdio.h>
  • src/merged.h

    diff -r b193168bad98 src/merged.h
     
    4444#endif
    4545
    4646#ifndef INCL_QT_QMAINWINDOW
    47 #include <QtGui/QMainWindow>
     47#include <QMainWindow>
    4848#define INCL_QT_QMAINWINDOW
    4949#endif
    5050
    5151#ifndef INCL_QT_QFRAME
    52 #include <QtGui/QFrame>
     52#include <QFrame>
    5353#define INCL_QT_QFRAME
    5454#endif
    5555
    5656#ifndef INCL_QT_QWIDGET
    57 #include <QtGui/QWidget>
     57#include <QWidget>
    5858#define INCL_QT_QWIDGET
    5959#endif
    6060
  • src/optionsDialog.cpp

    diff -r b193168bad98 src/optionsDialog.cpp
     
    3232
    3333#include <kdeSupport.h>
    3434
    35 #include <QtGui/QTabWidget>
    36 #include <QtGui/QTextEdit>
    37 #include <QtGui/QLineEdit>
    38 #include <QtGui/QCheckBox>
    39 #include <QtGui/QRadioButton>
    40 #include <QtGui/QPushButton>
    41 #include <QtGui/QSpinBox>
    42 #include <QtGui/QListWidgetItem>
    43 #include <QtGui/QListWidget>
    44 #include <QtGui/QColor>
    45 #include <QtGui/QColorDialog>
    46 #include <QtGui/QFontDialog>
    47 #include <QtGui/QLabel>
    48 #include <QtGui/QComboBox>
    49 #include <QtCore/QString>
    50 #include <QtGui/QPainter>
    51 #include <QtCore/QMetaType>
    52 #include <QtGui/QItemDelegate>
     35#include <QTabWidget>
     36#include <QTextEdit>
     37#include <QLineEdit>
     38#include <QCheckBox>
     39#include <QRadioButton>
     40#include <QPushButton>
     41#include <QSpinBox>
     42#include <QListWidgetItem>
     43#include <QListWidget>
     44#include <QColor>
     45#include <QColorDialog>
     46#include <QFontDialog>
     47#include <QLabel>
     48#include <QComboBox>
     49#include <QString>
     50#include <QPainter>
     51#include <QMetaType>
     52#include <QItemDelegate>
    5353
    5454#include <stdlib.h>
    5555
     
    153153{
    154154}
    155155
     156// copied from Qt 4.8's qvariant.h:
     157// template<typename T> inline T qvariant_cast(const QVariant &variant)
     158// {
     159//    return qvariant_cast<T>(variant);
     160// }
     161
    156162//------------------------------------------------------------------------------
    157163//
    158164inline XxColor XxColoredItem::color() const
    159165{
    160    return qVariantValue<XxColoredItemData>( data( Qt::DisplayRole ) )._color;
     166   return qvariant_cast<XxColoredItemData>( data( Qt::DisplayRole ) )._color;
    161167}
    162168
    163169//------------------------------------------------------------------------------
    164170//
    165171inline QColor XxColoredItem::foreColor() const
    166172{
    167    return qVariantValue<XxColoredItemData>( data( Qt::DisplayRole ) )._foreColor;
     173   return qvariant_cast<XxColoredItemData>( data( Qt::DisplayRole ) )._foreColor;
    168174}
    169175
    170176//------------------------------------------------------------------------------
    171177//
    172178inline QColor XxColoredItem::backColor() const
    173179{
    174    return qVariantValue<XxColoredItemData>( data( Qt::DisplayRole ) )._backColor;
     180   return qvariant_cast<XxColoredItemData>( data( Qt::DisplayRole ) )._backColor;
    175181}
    176182
    177183//------------------------------------------------------------------------------
    178184//
    179185inline bool XxColoredItem::modified() const
    180186{
    181    return qVariantValue<XxColoredItemData>( data( Qt::DisplayRole ) )._modified;
     187   return qvariant_cast<XxColoredItemData>( data( Qt::DisplayRole ) )._modified;
    182188}
    183189
    184190//------------------------------------------------------------------------------
    185191//
    186192void XxColoredItem::setForeColor( const QColor& color)
    187193{
    188    XxColoredItemData data = qVariantValue<XxColoredItemData>( this->data( Qt::DisplayRole ) );
     194   XxColoredItemData data = qvariant_cast<XxColoredItemData>( this->data( Qt::DisplayRole ) );
    189195   data._foreColor = color;
    190196   setData( Qt::DisplayRole, qVariantFromValue( data ) );
    191197}
     
    194200//
    195201void XxColoredItem::setBackColor( const QColor& color)
    196202{
    197    XxColoredItemData data = qVariantValue<XxColoredItemData>( this->data( Qt::DisplayRole ) );
     203   XxColoredItemData data = qvariant_cast<XxColoredItemData>( this->data( Qt::DisplayRole ) );
    198204   data._backColor = color;
    199205   setData( Qt::DisplayRole, qVariantFromValue( data ) );
    200206}
     
    203209//
    204210void XxColoredItem::setModified( const bool modified )
    205211{
    206    XxColoredItemData data = qVariantValue<XxColoredItemData>( this->data( Qt::DisplayRole ) );
     212   XxColoredItemData data = qvariant_cast<XxColoredItemData>( this->data( Qt::DisplayRole ) );
    207213   data._modified = modified;
    208214   setData( Qt::DisplayRole, qVariantFromValue( data ) );
    209215}
     
    260266{
    261267   painter->save();
    262268
    263    XxColoredItemData data = qVariantValue<XxColoredItemData>(index.data());
     269   XxColoredItemData data = qvariant_cast<XxColoredItemData>(index.data());
    264270
    265271   // Font.
    266272   painter->setFont( _resources->getFontText() );
  • src/overview.cpp

    diff -r b193168bad98 src/overview.cpp
     
    3030#include <diffs.h>
    3131#include <buffer.h>
    3232
    33 #include <QtGui/QPainter>
    34 #include <QtGui/QBrush>
    35 #include <QtGui/QPen>
    36 #include <QtGui/QColor>
    37 #include <QtGui/QWheelEvent>
    38 #include <QtGui/QResizeEvent>
    39 #include <QtGui/QFrame>
    40 #include <QtGui/QMouseEvent>
     33#include <QPainter>
     34#include <QBrush>
     35#include <QPen>
     36#include <QColor>
     37#include <QWheelEvent>
     38#include <QResizeEvent>
     39#include <QFrame>
     40#include <QMouseEvent>
    4141
    4242#include <math.h>
    4343
  • src/overview.h

    diff -r b193168bad98 src/overview.h
     
    3636#endif
    3737
    3838#ifndef INCL_QT_QFRAME
    39 #include <QtGui/QFrame>
     39#include <QFrame>
    4040#define INCL_QT_QFRAME
    4141#endif
    4242
  • src/resParser.cpp

    diff -r b193168bad98 src/resParser.cpp
     
    4343
    4444#include <kdeSupport.h>
    4545
    46 #include <QtGui/QKeySequence>
    47 #include <QtGui/QApplication>
    48 #include <QtGui/QFont>
    49 #include <QtCore/QFile>
    50 #include <QtCore/QFileInfo>
    51 #include <QtCore/QByteArray>
    52 #include <QtCore/QString>
    53 #include <QtGui/QStyleFactory>
    54 #include <QtGui/QDesktopWidget>
    55 #include <QtCore/QTextStream>
     46#include <QKeySequence>
     47#include <QApplication>
     48#include <QFont>
     49#include <QFile>
     50#include <QFileInfo>
     51#include <QByteArray>
     52#include <QString>
     53#include <QStyleFactory>
     54#include <QDesktopWidget>
     55#include <QTextStream>
    5656
    5757#include <stdexcept>
    5858#include <iostream>
  • src/resParser.h

    diff -r b193168bad98 src/resParser.h
     
    3636#endif
    3737
    3838#ifndef INCL_QT_QSTRING
    39 #include <QtCore/QString>
     39#include <QString>
    4040#define INCL_QT_QSTRING
    4141#endif
    4242
    4343#ifndef INCL_QT_QTEXTSTREAM
    44 #include <QtCore/QTextStream>
     44#include <QTextStream>
    4545#define INCL_QT_QTEXTSTREAM
    4646#endif
    4747
  • src/resParser.y

    diff -r b193168bad98 src/resParser.y
     
    2828#include <resParser.h>
    2929
    3030// Qt imports
    31 #include <QtCore/QString>
    32 #include <QtCore/QStringList>
    33 #include <QtCore/QRect>
    34 #include <QtGui/QStyleFactory>
     31#include <QString>
     32#include <QStringList>
     33#include <QRect>
     34#include <QStyleFactory>
    3535
    3636// The parser input is the resources object to fill in.
    3737#define RESOURCES  ( static_cast<XxResources*>(resources) )
  • src/resources.cpp

    diff -r b193168bad98 src/resources.cpp
     
    3131#include <exceptions.h>
    3232#include <util.h>
    3333
    34 #include <QtGui/QColor>
    35 #include <QtCore/QObject>
    36 #include <QtGui/QApplication> // to get desktop
    37 #include <QtCore/QRegExp>
    38 #include <QtGui/QStyleFactory>
     34#include <QColor>
     35#include <QObject>
     36#include <QApplication> // to get desktop
     37#include <QRegExp>
     38#include <QStyleFactory>
    3939
    4040#include <iostream>
    4141#include <string.h> // ::strcmp
  • src/resources.h

    diff -r b193168bad98 src/resources.h
     
    3232#endif
    3333
    3434#ifndef INCL_QT_QOBJECT
    35 #include <QtCore/QObject>
     35#include <QObject>
    3636#define INCL_QT_QOBJECT
    3737#endif
    3838
    3939#ifndef INCL_QT_QCOLOR
    40 #include <QtGui/QColor>
     40#include <QColor>
    4141#define INCL_QT_QCOLOR
    4242#endif
    4343
    4444#ifndef INCL_QT_QFONT
    45 #include <QtGui/QFont>
     45#include <QFont>
    4646#define INCL_QT_QFONT
    4747#endif
    4848
    4949#ifndef INCL_QT_QRECT
    50 #include <QtCore/QRect>
     50#include <QRect>
    5151#define INCL_QT_QFONT
    5252#endif
    5353
  • src/scrollView.cpp

    diff -r b193168bad98 src/scrollView.cpp
     
    2727#include <scrollView.h>
    2828#include <app.h>
    2929
    30 #include <QtGui/QScrollBar>
    31 #include <QtCore/QSize>
    32 #include <QtGui/QFont>
    33 #include <QtGui/QFontMetrics>
    34 #include <QtGui/QWheelEvent>
     30#include <QScrollBar>
     31#include <QSize>
     32#include <QFont>
     33#include <QFontMetrics>
     34#include <QWheelEvent>
    3535
    3636XX_NAMESPACE_BEGIN
    3737
  • src/scrollView.h

    diff -r b193168bad98 src/scrollView.h
     
    3636#endif
    3737
    3838#ifndef INCL_QT_QWIDGET
    39 #include <QtGui/QWidget>
     39#include <QWidget>
    4040#define INCL_QT_QWIDGET
    4141#endif
    4242
  • src/searchDialog.cpp

    diff -r b193168bad98 src/searchDialog.cpp
     
    2929#include <diffs.h>
    3030#include <app.h>
    3131
    32 #include <QtGui/QLineEdit>
    33 #include <QtGui/QPushButton>
    34 #include <QtGui/QComboBox>
     32#include <QLineEdit>
     33#include <QPushButton>
     34#include <QComboBox>
    3535
    3636XX_NAMESPACE_BEGIN
    3737
  • src/suicideMessageBox.h

    diff -r b193168bad98 src/suicideMessageBox.h
     
    3232#endif
    3333
    3434#ifndef INCL_QT_QMESSAGEBOX
    35 #include <QtGui/QMessageBox>
     35#include <QMessageBox>
    3636#define INCL_QT_QMESSAGEBOX
    3737#endif
    3838
  • src/text.cpp

    diff -r b193168bad98 src/text.cpp
     
    3333
    3434#include <kdeSupport.h>
    3535
    36 #include <QtGui/QPainter>
    37 #include <QtGui/QBrush>
    38 #include <QtGui/QPen>
    39 #include <QtGui/QColor>
    40 #include <QtGui/QMenu>
     36#include <QPainter>
     37#include <QBrush>
     38#include <QPen>
     39#include <QColor>
     40#include <QMenu>
    4141
    42 #include <QtGui/QApplication>
    43 #include <QtGui/QClipboard>
    44 #include <QtGui/QFrame>
    45 #include <QtGui/QResizeEvent>
    46 #include <QtGui/QMouseEvent>
    47 #include <QtGui/QWheelEvent>
     42#include <QApplication>
     43#include <QClipboard>
     44#include <QFrame>
     45#include <QResizeEvent>
     46#include <QMouseEvent>
     47#include <QWheelEvent>
    4848
    4949#include <math.h>
    5050#include <stdio.h>
  • src/text.h

    diff -r b193168bad98 src/text.h
     
    3636#endif
    3737
    3838#ifndef INCL_QT_QFRAME
    39 #include <QtGui/QFrame>
     39#include <QFrame>
    4040#define INCL_QT_QFRAME
    4141#endif
    4242
    4343#ifndef INCL_QT_QFONTMETRICS
    44 #include <QtGui/QFontMetrics>
     44#include <QFontMetrics>
    4545#define INCL_QT_QFONTMETRICS
    4646#endif
    4747
  • src/util.cpp

    diff -r b193168bad98 src/util.cpp
     
    2828#include <exceptions.h>
    2929#include <main.h>
    3030
    31 #include <QtCore/QString>
    32 #include <QtCore/QByteArray>
    33 #include <QtCore/QTextStream>
    34 #include <QtCore/QFileInfo>
    35 #include <QtCore/QRegExp>
    36 #include <QtCore/QDateTime>
     31#include <QString>
     32#include <QByteArray>
     33#include <QTextStream>
     34#include <QFileInfo>
     35#include <QRegExp>
     36#include <QDateTime>
    3737
    3838#include <iostream>
    3939#include <sys/types.h>
     
    235235      case 'U': { // - User name of owner
    236236         strcat( pformat, "s" );
    237237         QString tmp;
    238          tmp.sprintf( pformat,qfi.owner().toAscii().constData() );
     238         tmp.sprintf( pformat,qfi.owner().toLatin1().constData() );
    239239         target.append( tmp );
    240240      } break;
    241241
     
    249249      case 'G': { // - Group name of owner
    250250         strcat( pformat, "s" );
    251251         QString tmp;
    252          tmp.sprintf( pformat,qfi.group().toAscii().constData() );
     252         tmp.sprintf( pformat,qfi.group().toLatin1().constData() );
    253253         target.append( tmp );
    254254      } break;
    255255
     
    280280         // It's not the exact same as stat( 2 ) does, but this is ISO 8601
    281281         // and stat uses some weird syntax of it's own.
    282282         tmp.sprintf( pformat,
    283                       qfi.lastRead().toString( DATEFORMAT ).toAscii().constData() );
     283                      qfi.lastRead().toString( DATEFORMAT ).toLatin1().constData() );
    284284         target.append( tmp );
    285285      } break;
    286286
     
    297297         // It's not the exact same as stat( 2 ) does, but this is ISO 8601
    298298         // and stat uses some weird syntax of it's own.
    299299         tmp.sprintf( pformat,
    300                       qfi.lastModified().toString( DATEFORMAT ).toAscii().constData() );
     300                      qfi.lastModified().toString( DATEFORMAT ).toLatin1().constData() );
    301301         target.append( tmp );
    302302      } break;
    303303
     
    383383         // and stat uses some weird syntax of it's own.
    384384         tmp.sprintf(
    385385            pformat,
    386             ( QDateTime::currentDateTime() ).toString( DATEFORMAT ).toAscii().constData()
     386            ( QDateTime::currentDateTime() ).toString( DATEFORMAT ).toLatin1().constData()
    387387         );
    388388         target.append( tmp );
    389389      } break;
     
    403403         // and stat uses some weird syntax of it's own.
    404404         tmp.sprintf(
    405405            pformat,
    406             ( QDateTime::currentDateTime() ).toString( DATEFORMAT ).toAscii().constData() );
     406            ( QDateTime::currentDateTime() ).toString( DATEFORMAT ).toLatin1().constData() );
    407407         target.append( tmp );
    408408      } break;
    409409
     
    793793           break;
    794794       // use at() in case found+1 is past the end of the string
    795795       QChar escapedChar = newFormat.at( found+1 );
    796        switch( escapedChar.toAscii() ) {
     796       switch( escapedChar.toLatin1() ) {
    797797       case 'n':
    798798           newFormat = newFormat.replace( found, 2, QChar( '\n' ) );
    799799           break;
  • src/util.h

    diff -r b193168bad98 src/util.h
     
    3232#endif
    3333
    3434#ifndef INCL_QT_QSTRING
    35 #include <QtCore/QString>
     35#include <QString>
    3636#define INCL_QT_QSTRING
    3737#endif
    3838
    3939#ifndef INCL_QT_QFILEINFO
    40 #include <QtCore/QFileInfo>
     40#include <QFileInfo>
    4141#define INCL_QT_QFILEINFO
    4242#endif
    4343
    4444#ifndef INCL_QT_QSTRINGLIST
    45 #include <QtCore/QStringList>
     45#include <QStringList>
    4646#define INCL_QT_QSTRINGLIST
    4747#endif
    4848