26 files changed, 45 insertions, 45 deletions
diff --git a/core/apps/embeddedkonsole/TEWidget.cpp b/core/apps/embeddedkonsole/TEWidget.cpp index 5171bf1..bee58e7 100644 --- a/core/apps/embeddedkonsole/TEWidget.cpp +++ b/core/apps/embeddedkonsole/TEWidget.cpp @@ -232,49 +232,49 @@ static QChar vt100extended(QChar c) return c; } static QChar identicalMap(QChar c) { return c; } void TEWidget::fontChange(const QFont &) { QFontMetrics fm(font()); font_h = fm.height(); // font_w = fm.maxWidth(); font_w = fm.width("m"); font_a = fm.ascent(); printf("font h=%d max_width=%d width_m=%d assent=%d\n", font_h, fm.maxWidth(), font_w, font_a); //printf("font_h: %d\n",font_h); //printf("font_w: %d\n",font_w); //printf("font_a: %d\n",font_a); //printf("charset: %s\n",QFont::encodingName(font().charSet()).ascii()); //printf("rawname: %s\n",font().rawName().ascii()); fontMap = -#if QT_VERSION < 300 +#if QT_VERSION < 0x030000 strcmp(QFont::encodingName(font().charSet()).ascii(),"iso10646") ? vt100extended : #endif identicalMap; propagateSize(); update(); } void TEWidget::setVTFont(const QFont& f) { QFrame::setFont(f); } QFont TEWidget::getVTFont() { return font(); } void TEWidget::setFont(const QFont &) { // ignore font change request if not coming from konsole itself } /* ------------------------------------------------------------------------- */ diff --git a/core/apps/textedit/textedit.cpp b/core/apps/textedit/textedit.cpp index cabeb20..c7273c5 100644 --- a/core/apps/textedit/textedit.cpp +++ b/core/apps/textedit/textedit.cpp @@ -24,49 +24,49 @@ #include <qpe/config.h> #include <qpe/qpeapplication.h> /* QT */ #include <qmenubar.h> #include <qtoolbar.h> #include <qtextstream.h> #include <qclipboard.h> #include <qaction.h> #include <qlineedit.h> #include <qmessagebox.h> #include <qlayout.h> #include <qtimer.h> #include <qdir.h> /* STD */ #include <unistd.h> #include <sys/stat.h> #include <stdlib.h> //getenv using namespace Opie::Core; using namespace Opie::Ui; -#if QT_VERSION < 300 +#if QT_VERSION < 0x030000 class QpeEditor : public QMultiLineEdit { public: QpeEditor( QWidget *parent, const char * name = 0 ) : QMultiLineEdit( parent, name ) { clearTableFlags(); setTableFlags( Tbl_vScrollBar | Tbl_autoHScrollBar ); } void find( const QString &txt, bool caseSensitive, bool backwards ); protected: bool markIt; int line1, line2, col1, col2; void mousePressEvent( QMouseEvent * ); void mouseReleaseEvent( QMouseEvent * ); //public slots: /* signals: void notFound(); void searchWrapped(); */ diff --git a/core/opie-login/loginwindowimpl.cpp b/core/opie-login/loginwindowimpl.cpp index 73c2cbe..ac24894 100644 --- a/core/opie-login/loginwindowimpl.cpp +++ b/core/opie-login/loginwindowimpl.cpp @@ -12,49 +12,49 @@ .i_,=:_. -<s. This file is distributed in the hope that + . -:. = it will be useful, but WITHOUT ANY WARRANTY; : .. .:, . . . without even the implied warranty of =_ + =;=|` MERCHANTABILITY or FITNESS FOR A _.=:. : :=>`: PARTICULAR PURPOSE. See the GNU General ..}^=.= = ; Public License for more details. ++= -. .` .: : = ...= . :.=- You should have received a copy of the GNU -. .:....=;==+<; General Public License along with this file; -_. . . )=. = see the file COPYING. If not, write to the -- :-=` Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #include <qpe/version.h> #include <qpushbutton.h> #include <qlayout.h> #include <qlineedit.h> #include <qtimer.h> #include <qcombobox.h> #include <qlabel.h> #include <qpopupmenu.h> #include <qmessagebox.h> -#if QT_VERSION < 300 +#if QT_VERSION < 0x030000 #include <qgfx_qws.h> #endif #include <qwindowsystem_qws.h> #include <qpe/resource.h> #include <qpe/qcopenvelope_qws.h> #include <qpe/config.h> #include <opie2/odevice.h> #include <stdio.h> #include <stdlib.h> #include "passworddialogimpl.h" #include "loginwindowimpl.h" #include "loginapplication.h" #include "inputmethods.h" using namespace Opie::Core; LoginWindowImpl::LoginWindowImpl ( ) : LoginWindow ( 0, "LOGIN-WINDOW", WStyle_Customize | WStyle_NoBorder | WDestructiveClose ) { QPopupMenu *pop = new QPopupMenu ( this ); @@ -115,49 +115,49 @@ LoginWindowImpl::~LoginWindowImpl ( ) void LoginWindowImpl::receive ( const QCString &msg, const QByteArray &data ) { QDataStream stream ( data, IO_ReadOnly ); if ( msg == "hideInputMethod()" ) m_input-> hideInputMethod ( ); else if ( msg == "showInputMethod()" ) m_input-> showInputMethod ( ); else if ( msg == "reloadInputMethods()" ) m_input-> loadInputMethods ( ); } void LoginWindowImpl::calcMaxWindowRect ( ) { #ifdef Q_WS_QWS QRect wr; int displayWidth = qApp-> desktop ( )-> width ( ); QRect ir = m_input-> inputRect ( ); if ( ir.isValid() ) wr.setCoords( 0, 0, displayWidth-1, ir.top()-1 ); else wr.setCoords( 0, 0, displayWidth-1, m_taskbar->y()-1 ); -#if QT_VERSION < 300 +#if QT_VERSION < 0x030000 wr = qt_screen-> mapToDevice ( wr, QSize ( qt_screen-> width ( ), qt_screen-> height ( ))); #endif QWSServer::setMaxWindowRect( wr ); #endif } void LoginWindowImpl::keyPressEvent ( QKeyEvent *e ) { switch ( e-> key ( )) { case HardKey_Suspend: suspend ( ); break; case HardKey_Backlight: backlight ( ); break; default: e-> ignore ( ); break; } LoginWindow::keyPressEvent ( e ); } void LoginWindowImpl::toggleEchoMode ( bool t ) { diff --git a/freetype/fontfactoryttf_qws.h b/freetype/fontfactoryttf_qws.h index 208ab61..ff0fcfc 100644 --- a/freetype/fontfactoryttf_qws.h +++ b/freetype/fontfactoryttf_qws.h @@ -2,49 +2,49 @@ ** Copyright (C) 2000-2002 Trolltech AS. All rights reserved. ** ** This file is part of the Qtopia Environment. ** ** This file may be distributed and/or modified under the terms of the ** GNU General Public License version 2 as published by the Free Software ** Foundation and appearing in the file LICENSE.GPL included in the ** packaging of this file. ** ** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE ** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. ** ** See http://www.trolltech.com/gpl/ for GPL licensing information. ** ** Contact info@trolltech.com if any conditions of this licensing are ** not clear to you. ** **********************************************************************/ #ifndef FONTFACTORY_FT_H #define FONTFACTORY_FT_H #include <qfontmanager_qws.h> -#if QT_VERSION >= 300 +#if QT_VERSION >= 0x030000 # include <private/qfontdata_p.h> #else # include "qfontdata_p.h" #endif #ifdef QT_NO_FREETYPE extern "C" { #include <freetype/freetype.h> } // ascent, descent, width(ch), width(string), maxwidth? // leftbearing, rightbearing, minleftbearing,minrightbearing // leading class QFontFactoryFT : public QFontFactory { public: QFontFactoryFT(); virtual ~QFontFactoryFT(); QRenderedFont * get(const QFontDef &,QDiskFont *); diff --git a/libopie2/opieui/oseparator.cpp b/libopie2/opieui/oseparator.cpp index bbc4381..177368b 100644 --- a/libopie2/opieui/oseparator.cpp +++ b/libopie2/opieui/oseparator.cpp @@ -87,43 +87,43 @@ int OSeparator::orientation() const if ( frameStyle() & VLine ) return VLine; if ( frameStyle() & HLine ) return HLine; return 0; } void OSeparator::drawFrame(QPainter *p) { QPoint p1, p2; QRect r = frameRect(); const QColorGroup & g = colorGroup(); if ( frameStyle() & HLine ) { p1 = QPoint( r.x(), r.height()/2 ); p2 = QPoint( r.x()+r.width(), p1.y() ); } else { p1 = QPoint( r.x()+r.width()/2, 0 ); p2 = QPoint( p1.x(), r.height() ); } -#if QT_VERSION < 300 +#if QT_VERSION < 0x030000 style().drawSeparator( p, p1.x(), p1.y(), p2.x(), p2.y(), g, true, 1, midLineWidth() ); #else QStyleOption opt( lineWidth(), midLineWidth() ); style().drawPrimitive( QStyle::PE_Separator, p, QRect( p1, p2 ), g, QStyle::Style_Sunken, opt ); #endif } QSize OSeparator::sizeHint() const { if ( frameStyle() & VLine ) return QSize(2, 0); if ( frameStyle() & HLine ) return QSize(0, 2); return QSize(-1, -1); } diff --git a/libopie2/qt3/opieui/oeditlistbox.h b/libopie2/qt3/opieui/oeditlistbox.h index 63fab11..c9c207d 100644 --- a/libopie2/qt3/opieui/oeditlistbox.h +++ b/libopie2/qt3/opieui/oeditlistbox.h @@ -6,49 +6,49 @@ License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public License for more details. You should have received a copy of the GNU Library General Public License along with this library; see the file COPYING.LIB. If not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #ifndef OEDITLISTBOX_H #define OEDITLISTBOX_H #include <qgroupbox.h> #include <qlistbox.h> class OLineEdit; class OComboBox; class QPushButton; -#if QT_VERSION < 300 +#if QT_VERSION < 0x030000 enum StringComparisonMode { CaseSensitive = 0x00001, // 0 0001 BeginsWith = 0x00002, // 0 0010 EndsWith = 0x00004, // 0 0100 Contains = 0x00008, // 0 1000 ExactMatch = 0x00010 // 1 0000 }; #endif class OEditListBoxPrivate; /** * An editable listbox * * This class provides a editable listbox ;-), this means * a listbox which is accompanied by a line edit to enter new * items into the listbox and pushbuttons to add and remove * items from the listbox and two buttons to move items up and down. */ class OEditListBox : public QGroupBox { Q_OBJECT public: /// @since 3.1 diff --git a/libopie2/qt3/opieui/ojanuswidget.cpp b/libopie2/qt3/opieui/ojanuswidget.cpp index 063e393..8bdbc03 100644 --- a/libopie2/qt3/opieui/ojanuswidget.cpp +++ b/libopie2/qt3/opieui/ojanuswidget.cpp @@ -751,49 +751,49 @@ void OJanusWidget::setFocus() mTabControl->setFocus(); } else if( mFace == Swallow ) { mSwallowPage->setFocus(); } else if( mFace == Plain ) { mPlainPage->setFocus(); } } QSize OJanusWidget::minimumSizeHint() const { if( mFace == TreeList || mFace == IconList ) { QSize s1( ODialog::spacingHint(), ODialog::spacingHint()*2 ); QSize s2(0,0); QSize s3(0,0); QSize s4( mPageStack->sizeHint() ); if( mFace == TreeList ) { -#if QT_VERSION < 300 +#if QT_VERSION < 0x030000 s1.rwidth() += style().splitterWidth(); #else s1.rwidth() += style().pixelMetric( QStyle::PM_SplitterWidth ); #endif s2 = mTreeList->minimumSize(); } else { mIconList->updateMinimumHeight(); mIconList->updateWidth(); s2 = mIconList->minimumSize(); } if( mTitleLabel->isVisible() == true ) { s3 += mTitleLabel->sizeHint(); s3.rheight() += mTitleSep->minimumSize().height(); } // // Select the tallest item. It has only effect in IconList mode // int h1 = s1.rheight() + s3.rheight() + s4.height(); int h2 = QMAX( h1, s2.rheight() ); diff --git a/library/lightstyle.cpp b/library/lightstyle.cpp index f18bdca..3bd1623 100644 --- a/library/lightstyle.cpp +++ b/library/lightstyle.cpp @@ -1,46 +1,46 @@ /********************************************************************** ** Copyright (C) 2000 Trolltech AS. All rights reserved. ** ** This file is part of Qtopia Environment. ** ** This file may be distributed and/or modified under the terms of the ** GNU General Public License version 2 as published by the Free Software ** Foundation and appearing in the file LICENSE.GPL included in the ** packaging of this file. ** ** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE ** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. ** ** See http://www.trolltech.com/gpl/ for GPL licensing information. ** ** Contact info@trolltech.com if any conditions of this licensing are ** not clear to you. ** **********************************************************************/ #include "lightstyle.h" -#if QT_VERSION < 300 +#if QT_VERSION < 0x030000 #define INCLUDE_MENUITEM_DEF #include "qmenubar.h" #include "qapplication.h" #include "qpainter.h" #include "qpalette.h" #include "qframe.h" #include "qpushbutton.h" #include "qdrawutil.h" #include "qscrollbar.h" #include "qtabbar.h" #include "qguardedptr.h" #include "qlayout.h" #include "qlineedit.h" class LightStylePrivate { public: LightStylePrivate() : hoverWidget(0), ref(1), savePalette(0) { } @@ -138,66 +138,66 @@ int LightStyle::buttonMargin() const QSize LightStyle::exclusiveIndicatorSize() const { return QSize(13, 13); } int LightStyle::defaultFrameWidth() const { return 2; } QSize LightStyle::indicatorSize() const { return QSize(13, 13); } void LightStyle::polish(QWidget *widget) { if (widget->inherits("QPushButton")) widget->installEventFilter(this); -#if QT_VERSION >= 300 +#if QT_VERSION >= 0x030000 if (widget->inherits("QLineEdit")) { QLineEdit *lineedit = (QLineEdit *) widget; lineedit->setFrameShape(QFrame::StyledPanel); lineedit->setLineWidth(2); } #endif QWindowsStyle::polish(widget); } void LightStyle::unPolish(QWidget *widget) { if (widget->inherits("QPushButton")) widget->removeEventFilter(this); -#if QT_VERSION >= 300 +#if QT_VERSION >= 0x030000 if (widget->inherits("QLineEdit")) { QLineEdit *lineedit = (QLineEdit *) widget; lineedit->setLineWidth(1); lineedit->setFrameShape(QFrame::WinPanel); } #endif QWindowsStyle::unPolish(widget); } void LightStyle::polish(QApplication *app) { QPalette pal = app->palette(); QColorGroup active(pal.color(QPalette::Active, QColorGroup::Foreground), // foreground pal.color(QPalette::Active, QColorGroup::Button), // button pal.color(QPalette::Active, QColorGroup::Background).light(), // light pal.color(QPalette::Active, QColorGroup::Background).dark(175), // dark pal.color(QPalette::Active, @@ -393,66 +393,66 @@ void LightStyle::drawBevelButton(QPainter *p, int x, int y, int w, int h, void LightStyle::getButtonShift(int &x, int &y) const { x = y = 0; } void LightStyle::drawComboButton(QPainter *p, int x, int y, int w, int h, const QColorGroup &g, bool, bool editable, bool, const QBrush *fill) { drawButton(p, x, y, w, h, g, FALSE, fill); if (editable) { QRect r = comboButtonRect(x, y, w, h); qDrawShadePanel(p, r.x() - 1, r.y() - 1, r.width() + defaultFrameWidth(), r.height() + defaultFrameWidth(), g, TRUE); } int indent = ((y + h) / 2) - 3; int xpos = x; -#if QT_VERSION >= 300 +#if QT_VERSION >= 0x030000 if( QApplication::reverseLayout() ) xpos += indent; else #endif xpos += w - indent - 5; drawArrow(p, Qt::DownArrow, TRUE, xpos, indent, 5, 5, g, TRUE, fill); } QRect LightStyle::comboButtonRect( int x, int y, int w, int h ) const { QRect r(x + 3, y + 3, w - 6, h - 6); int indent = ((y + h) / 2) - 3; r.setRight(r.right() - indent - 10); -#if QT_VERSION >= 300 +#if QT_VERSION >= 0x030000 if( QApplication::reverseLayout() ) r.moveBy( indent + 10, 0 ); #endif return r; } QRect LightStyle::comboButtonFocusRect(int x, int y, int w, int h ) const { return comboButtonRect(x, y, w, h); } void LightStyle::drawPanel(QPainter *p, int x, int y, int w, int h, const QColorGroup &g, bool sunken, int lw, const QBrush *fill) { if (lw >= 2) { if ( fill ) p->fillRect(x + 2, y + 2, w - 4, h - 4, *fill); QPen oldpen = p->pen(); diff --git a/library/lightstyle.h b/library/lightstyle.h index c377cc2..0392957 100644 --- a/library/lightstyle.h +++ b/library/lightstyle.h @@ -5,49 +5,49 @@ ** ** This file may be distributed and/or modified under the terms of the ** GNU General Public License version 2 as published by the Free Software ** Foundation and appearing in the file LICENSE.GPL included in the ** packaging of this file. ** ** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE ** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. ** ** See http://www.trolltech.com/gpl/ for GPL licensing information. ** ** Contact info@trolltech.com if any conditions of this licensing are ** not clear to you. ** **********************************************************************/ #ifndef LIGHTSTYLE_H #define LIGHTSTYLE_H #ifndef QT_H #include <qstyle.h> #include <qwindowsstyle.h> #endif // QT_H -#if QT_VERSION < 300 +#if QT_VERSION < 0x030000 #ifdef QT_PLUGIN_STYLE_LIGHT # define Q_EXPORT_STYLE_LIGHT #else # define Q_EXPORT_STYLE_LIGHT Q_EXPORT #endif // QT_PLUGIN_STYLE_LIGHT class Q_EXPORT_STYLE_LIGHT LightStyle : public QWindowsStyle { public: LightStyle(); virtual ~LightStyle(); void polish(QWidget *widget); void unPolish(QWidget*widget); void polish(QApplication *app); void unPolish(QApplication *app); void polishPopupMenu(QPopupMenu *menu); void drawPushButton(QPushButton *button, QPainter *p); void drawButton(QPainter *p, int x, int y, int w, int h, diff --git a/library/qpeapplication.cpp b/library/qpeapplication.cpp index af00f49..1c5ced3 100644 --- a/library/qpeapplication.cpp +++ b/library/qpeapplication.cpp @@ -39,49 +39,49 @@ #include <qwindowsystem_qws.h> #endif #include <qtextstream.h> #include <qpalette.h> #include <qbuffer.h> #include <qptrdict.h> #include <qregexp.h> #include <qdir.h> #include <qlabel.h> #include <qdialog.h> #include <qdragobject.h> #include <qtextcodec.h> #include <qevent.h> #include <qtooltip.h> #include <qsignal.h> #include <qmainwindow.h> #include <qwidgetlist.h> #include <qpixmapcache.h> #if defined(Q_WS_QWS) && !defined(QT_NO_COP) #define QTOPIA_INTERNAL_INITAPP #include "qpeapplication.h" #include "qpestyle.h" #include "styleinterface.h" -#if QT_VERSION >= 300 +#if QT_VERSION >= 0x030000 #include <qstylefactory.h> #else #include <qplatinumstyle.h> #include <qwindowsstyle.h> #include <qmotifstyle.h> #include <qmotifplusstyle.h> #include "lightstyle.h" #include <qpe/qlibrary.h> #endif #include "global.h" #include "resource.h" #if QT_VERSION <= 230 && defined(QT_NO_CODECS) #include "qutfcodec.h" #endif #include "config.h" #include "network.h" #ifdef QWS #include "fontmanager.h" #include "fontdatabase.h" #endif #include "alarmserver.h" #include "applnk.h" @@ -1822,49 +1822,49 @@ void QPEApplication::showMainDocumentWidget( QWidget* mw, bool nomaximize ) void QPEApplication::setKeepRunning() { if ( qApp && qApp->inherits( "QPEApplication" ) ) { QPEApplication * qpeApp = ( QPEApplication* ) qApp; qpeApp->d->keep_running = TRUE; } } /*! Returns TRUE if the application will quit after processing the current list of qcop messages; otherwise returns FALSE. \sa setKeepRunning() */ bool QPEApplication::keepRunning() const { return d->keep_running; } /*! \internal */ void QPEApplication::internalSetStyle( const QString &style ) { -#if QT_VERSION >= 300 +#if QT_VERSION >= 0x030000 if ( style == "QPE" ) { setStyle( new QPEStyle ); } else { QStyle *s = QStyleFactory::create( style ); if ( s ) setStyle( s ); } #else if ( style == "Windows" ) { setStyle( new QWindowsStyle ); } else if ( style == "QPE" ) { setStyle( new QPEStyle ); } else if ( style == "Light" ) { setStyle( new LightStyle ); } #ifndef QT_NO_STYLE_PLATINUM else if ( style == "Platinum" ) { setStyle( new QPlatinumStyle ); } #endif #ifndef QT_NO_STYLE_MOTIF diff --git a/library/qpestyle.cpp b/library/qpestyle.cpp index b61ada4..0566f6b 100644 --- a/library/qpestyle.cpp +++ b/library/qpestyle.cpp @@ -2,49 +2,49 @@ ** Copyright (C) 2000 Trolltech AS. All rights reserved. ** ** This file is part of Qtopia Environment. ** ** This file may be distributed and/or modified under the terms of the ** GNU General Public License version 2 as published by the Free Software ** Foundation and appearing in the file LICENSE.GPL included in the ** packaging of this file. ** ** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE ** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. ** ** See http://www.trolltech.com/gpl/ for GPL licensing information. ** ** Contact info@trolltech.com if any conditions of this licensing are ** not clear to you. ** **********************************************************************/ #include "qpestyle.h" #define QCOORDARRLEN(x) sizeof(x)/(sizeof(QCOORD)*2) -#if QT_VERSION >= 300 +#if QT_VERSION >= 0x030000 #include <qdrawutil.h> #include <qcombobox.h> #include <qtabbar.h> QPEStyle::QPEStyle() { } QPEStyle::~QPEStyle() { } void QPEStyle::drawPrimitive( PrimitiveElement pe, QPainter *p, const QRect &r, const QColorGroup &cg, SFlags flags, const QStyleOption &data) const { switch ( pe ) { case PE_ButtonTool: { QColorGroup mycg = cg; if ( flags & Style_On ) { QBrush fill( cg.mid(), Dense4Pattern ); mycg.setBrush( QColorGroup::Button, fill ); } @@ -408,49 +408,49 @@ QSize QPEStyle::sizeFromContents( ContentsType contents, const QWidget *widget, } default: sz = QWindowsStyle::sizeFromContents( contents, widget, contentsSize, data ); break; } return sz; } #else #include <qfontmetrics.h> #include <qpalette.h> #include <qdrawutil.h> #include <qscrollbar.h> #include <qbutton.h> #include <qframe.h> #include <qtabbar.h> #define INCLUDE_MENUITEM_DEF #include <qmenudata.h> QPEStyle::QPEStyle() { -#if QT_VERSION < 300 +#if QT_VERSION < 0x030000 setButtonMargin(buttonMargin()); setScrollBarExtent(scrollBarExtent().width(),scrollBarExtent().height()); #endif } QPEStyle::~QPEStyle() { } int QPEStyle::buttonMargin() const { return 2; } QSize QPEStyle::scrollBarExtent() const { return QSize(13,13); } void QPEStyle::polish ( QPalette & ) { } void QPEStyle::polish( QWidget *w ) diff --git a/library/qpestyle.h b/library/qpestyle.h index 19ef346..1bde0ff 100644 --- a/library/qpestyle.h +++ b/library/qpestyle.h @@ -4,49 +4,49 @@ ** This file is part of Qtopia Environment. ** ** This file may be distributed and/or modified under the terms of the ** GNU General Public License version 2 as published by the Free Software ** Foundation and appearing in the file LICENSE.GPL included in the ** packaging of this file. ** ** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE ** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. ** ** See http://www.trolltech.com/gpl/ for GPL licensing information. ** ** Contact info@trolltech.com if any conditions of this licensing are ** not clear to you. ** **********************************************************************/ #ifndef QPESTYLE_H #define QPESTYLE_H #ifndef QT_H #include "qwindowsstyle.h" #endif // QT_H -#if QT_VERSION >= 300 +#if QT_VERSION >= 0x030000 class Q_EXPORT QPEStyle : public QWindowsStyle { public: QPEStyle(); virtual ~QPEStyle(); virtual void drawPrimitive( PrimitiveElement pe, QPainter *p, const QRect &r, const QColorGroup &cg, SFlags flags=Style_Default, const QStyleOption & = QStyleOption::Default) const; virtual void drawControl( ControlElement ce, QPainter *p, const QWidget *widget, const QRect &r, const QColorGroup &cg, SFlags how=Style_Default, const QStyleOption & = QStyleOption::Default) const; virtual void drawComplexControl( ComplexControl control, QPainter *p, const QWidget *widget, const QRect &r, const QColorGroup &cg, SFlags how=Style_Default, SCFlags sub=SC_All, SCFlags subActive=SC_None, const QStyleOption & = QStyleOption::Default) const; virtual int pixelMetric( PixelMetric metric, const QWidget *widget=0 ) const; virtual QSize sizeFromContents( ContentsType contents, const QWidget *widget, const QSize &contentsSize, const QStyleOption & = QStyleOption::Default) const; }; #else class Q_EXPORT QPEStyle : public QWindowsStyle { public: QPEStyle(); virtual ~QPEStyle(); virtual void polish( QPalette &p ); virtual void polish( QWidget *w ); virtual void unPolish( QWidget *w ); diff --git a/noncore/apps/opie-console/TEWidget.cpp b/noncore/apps/opie-console/TEWidget.cpp index 98c1793..1199e4f 100644 --- a/noncore/apps/opie-console/TEWidget.cpp +++ b/noncore/apps/opie-console/TEWidget.cpp @@ -243,49 +243,49 @@ static QChar vt100extended(QChar c) case 0x2260 : return 29; case 0x00a3 : return 30; case 0x00b7 : return 31; } return c; } static QChar identicalMap(QChar c) { return c; } void TEWidget::fontChange(const QFont &) { QFontMetrics fm(font()); font_h = fm.height(); font_w = fm.maxWidth(); font_a = fm.ascent(); //printf("font_h: %d\n",font_h); //printf("font_w: %d\n",font_w); //printf("font_a: %d\n",font_a); //printf("charset: %s\n",QFont::encodingName(font().charSet()).ascii()); //printf("rawname: %s\n",font().rawName().ascii()); fontMap = -#if QT_VERSION < 300 +#if QT_VERSION < 0x030000 strcmp(QFont::encodingName(font().charSet()).ascii(),"iso10646") ? vt100extended : #endif identicalMap; propagateSize(); update(); } void TEWidget::setVTFont(const QFont& f) { QFrame::setFont(f); } QFont TEWidget::getVTFont() { return font(); } void TEWidget::setFont(const QFont &) { // ignore font change request if not coming from konsole itself } /* ------------------------------------------------------------------------- */ diff --git a/noncore/apps/tinykate/libkate/qt3back/qregexp3.cpp b/noncore/apps/tinykate/libkate/qt3back/qregexp3.cpp index 78635b2..7b30b1a 100644 --- a/noncore/apps/tinykate/libkate/qt3back/qregexp3.cpp +++ b/noncore/apps/tinykate/libkate/qt3back/qregexp3.cpp @@ -13,53 +13,53 @@ ** as defined by Trolltech AS of Norway and appearing in the file ** LICENSE.QPL included in the packaging of this file. ** ** This file may be distributed and/or modified under the terms of the ** GNU General Public License version 2 as published by the Free Software ** Foundation and appearing in the file LICENSE.GPL included in the ** packaging of this file. ** ** Licensees holding valid Qt Enterprise Edition or Qt Professional Edition ** licenses may use this file in accordance with the Qt Commercial License ** Agreement provided with the Software. ** ** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE ** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. ** ** See http://www.trolltech.com/pricing.html or email sales@trolltech.com for ** information about Qt Commercial License Agreements. ** See http://www.trolltech.com/qpl/ for QPL licensing information. ** See http://www.trolltech.com/gpl/ for GPL licensing information. ** ** Contact info@trolltech.com if any conditions of this licensing are ** not clear to you. ** **********************************************************************/ -#if QT_VERSION >=300 +#if QT_VERSION >= 0x030000 #error QRegExp3 is now in QT 3 use QRegExp instead #endif -#if QT_VERSION < 300 +#if QT_VERSION < 0x030000 #include "./qregexp3.h" #else #include "qregexp.h" #endif /* OPIE */ #include <opie2/odebug.h> /* QT */ #include <qarray.h> #include <qbitarray.h> #include <qcache.h> #include <qintdict.h> #include <qmap.h> #include <qstring.h> #include <qtl.h> #include <qvector.h> /* STD */ #include <limits.h> /* WARNING! Be sure to read qregexp.tex before modifying this file. */ diff --git a/noncore/apps/tinykate/libkate/qt3back/qregexp3.h b/noncore/apps/tinykate/libkate/qt3back/qregexp3.h index 5b75131..fd6bc78 100644 --- a/noncore/apps/tinykate/libkate/qt3back/qregexp3.h +++ b/noncore/apps/tinykate/libkate/qt3back/qregexp3.h @@ -21,49 +21,49 @@ ** Licensees holding valid Qt Enterprise Edition or Qt Professional Edition ** licenses may use this file in accordance with the Qt Commercial License ** Agreement provided with the Software. ** ** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE ** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. ** ** See http://www.trolltech.com/pricing.html or email sales@trolltech.com for ** information about Qt Commercial License Agreements. ** See http://www.trolltech.com/qpl/ for QPL licensing information. ** See http://www.trolltech.com/gpl/ for GPL licensing information. ** ** Contact info@trolltech.com if any conditions of this licensing are ** not clear to you. ** **********************************************************************/ #ifndef QREGEXP3_H #define QREGEXP3_H #ifndef QT_H #include "qstringlist.h" #endif // QT_H -#if QT_VERSION >=300 +#if QT_VERSION >= 0x030000 #include <qregexp.h> #else class QRegExpEngine; struct QRegExpPrivate; class Q_EXPORT QRegExp3 { public: QRegExp3(); QRegExp3( const QString& pattern, bool caseSensitive = TRUE, bool wildcard = FALSE ); QRegExp3( const QRegExp3& rx ); ~QRegExp3(); QRegExp3& operator=( const QRegExp3& rx ); bool operator==( const QRegExp3& rx ) const; bool operator!=( const QRegExp3& rx ) const { return !operator==( rx ); } bool isEmpty() const; bool isValid() const; QString pattern() const; void setPattern( const QString& pattern ); bool caseSensitive() const; void setCaseSensitive( bool sensitive ); @@ -86,26 +86,26 @@ public: #ifdef QCHAR_SUPPORT int search(const QChar *str,int start=0); int search(const QChar *str,int start=0) const; int searchRev(const QChar *str,int start=-1); int searchRev(const QChar *str,int start=-1) const ; bool exactMatch(const QChar *str); bool exactMatch(const QChar *str) const; // end QChar versions #endif int searchRev( const QString& str, int start = -1 ); int searchRev( const QString& str, int start = -1 ) const; int matchedLength(); #ifndef QT_NO_REGEXP_CAPTURE QStringList capturedTexts(); QString cap( int nth = 0 ); int pos( int nth = 0 ); #endif private: void compile( bool caseSensitive ); QRegExpEngine *eng; QRegExpPrivate *priv; }; -#endif // QT_VERSION >= 300 +#endif // QT_VERSION >= 0x030000 #endif // QREGEXP_H diff --git a/noncore/apps/zsafe/shadedlistitem.cpp b/noncore/apps/zsafe/shadedlistitem.cpp index 72c6261..7f340f9 100644 --- a/noncore/apps/zsafe/shadedlistitem.cpp +++ b/noncore/apps/zsafe/shadedlistitem.cpp @@ -31,39 +31,39 @@ ShadedListItem::ShadedListItem(int index, QListView *parent, QListViewItem *afte oddRow = (index % 2 != 0); } ShadedListItem::ShadedListItem(int index, QListView *parent, QString label1, QString label2, QString label3) : QListViewItem(parent, label1, label2, label3), lv(parent) { oddRow = (index % 2 != 0); } ShadedListItem::ShadedListItem(int index, QListView *parent, QListViewItem *after, QString label1, QString label2, QString label3) : QListViewItem(parent, after, label1, label2, label3), lv(parent) { oddRow = (index % 2 != 0); } ShadedListItem::~ShadedListItem() { } void ShadedListItem::paintCell(QPainter *p, const QColorGroup &cg, int column, int width, int alignment) { QColorGroup colors(cg); -#if QT_VERSION >=300 +#if QT_VERSION >= 0x030000 const QColorGroup::ColorRole crole = QColorGroup::Base; // const QWidget::BackgroundMode bgmode = lv->viewport()->backgroundMode(); // const QColorGroup::ColorRole crole = QPalette::backgroundRoleFromMode(bgmode); #else const QColorGroup::ColorRole crole = QColorGroup::Base; #endif if (oddRow) { colors.setColor(crole, *ZSafe::oddRowColor); } else { colors.setColor(crole, *ZSafe::evenRowColor); } QListViewItem::paintCell(p, colors, column, width, alignment); } diff --git a/noncore/net/wellenreiter/gui/configwindow.cpp b/noncore/net/wellenreiter/gui/configwindow.cpp index 1670f93..9ec5af9 100644 --- a/noncore/net/wellenreiter/gui/configwindow.cpp +++ b/noncore/net/wellenreiter/gui/configwindow.cpp @@ -351,104 +351,104 @@ void WellenreiterConfigWindow::performAction( const QString& type, return; } default: assert( false ); } } void WellenreiterConfigWindow::load() { #ifdef Q_WS_X11 #warning Persistent Configuration not yet implemented for standalone X11 build performAutodetection(); #else odebug << "loading configuration settings..." << oendl; /* This is dumb monkey typing stuff... We _need_ to do this automatically! */ OConfig* c = oApp->config(); c->setGroup( "Interface" ); QString interface = c->readEntry( "name", "<none>" ); if ( interface != "<none>" ) { -#if QT_VERSION < 300 +#if QT_VERSION < 0x030000 interfaceName->insertItem( interface, 0 ); interfaceName->setCurrentItem( 0 ); #else interfaceName->setCurrentText( interface ); #endif QString device = c->readEntry( "type", "<select>" ); -#if QT_VERSION < 300 +#if QT_VERSION < 0x030000 for ( int i = 0; i < deviceType->count(); ++i ) { if ( deviceType->text( i ) == device ) { deviceType->setCurrentItem( i ); break; } } #else deviceType->setCurrentText( device ); #endif } else { performAutodetection(); } prismHeader->setChecked( c->readBoolEntry( "prism", false ) ); hopChannels->setChecked( c->readBoolEntry( "hop", true ) ); hopInterval->setValue( c->readNumEntry( "interval", 250 ) ); adaptiveHopping->setChecked( c->readBoolEntry( "adaptive", true ) ); c->setGroup( "Capture" ); writeCaptureFile->setChecked( c->readBoolEntry( "writeCaptureFile", true ) ); captureFileName->setEnabled( writeCaptureFile->isChecked() ); getCaptureFileName->setEnabled( writeCaptureFile->isChecked() ); parsePackets->setEnabled( writeCaptureFile->isChecked() ); captureFileName->setText( c->readEntry( "filename", "/tmp/capture" ) ); hexViewBufferUnlimited->setChecked( c->readBoolEntry( "hexViewBufferUnlimited", true ) ); hexViewBufferLimited->setChecked( !c->readBoolEntry( "hexViewBufferUnlimited", true ) ); hexViewBufferSize->setValue( c->readNumEntry( "hexViewBufferSize", 2000 ) ); c->setGroup( "UI" ); lookupVendor->setChecked( c->readBoolEntry( "lookupVendor", true ) ); openTree->setChecked( c->readBoolEntry( "openTree", true ) ); disablePM->setChecked( c->readBoolEntry( "disablePM", true ) ); newNetworkAction->setCurrentItem( c->readNumEntry( "newNetworkAction", 1 ) ); // Default: Play Alarm newNetworkScript->setText( c->readEntry( "newNetworkScript", "" ) ); newClientAction->setCurrentItem( c->readNumEntry( "newClientAction", 2 ) ); // Default: Play Click newClientScript->setText( c->readEntry( "newClientScript", "" ) ); newStationAction->setCurrentItem( c->readNumEntry( "newStationAction", 2 ) ); // Default: Play Click newStationScript->setText( c->readEntry( "newStationScript", "" ) ); synchronizeActionsAndScripts(); // needed for showing/hiding the script QLineEdit on demand c->setGroup( "GPS" ); enableGPS->setChecked( c->readBoolEntry( "use", false ) ); -#if QT_VERSION < 300 +#if QT_VERSION < 0x030000 gpsdHost->insertItem( c->readEntry( "host", "localhost" ), 0 ); gpsdHost->setCurrentItem( 0 ); #else gpsdHost->setCurrentText( c->readEntry( "host", "localhost" ) ); #endif gpsdPort->setValue( c->readNumEntry( "port", 2947 ) ); startGPS->setChecked( c->readBoolEntry( "start", false ) ); commandGPS->setText( c->readEntry( "command", "gpsd -p /dev/ttyS3 -s 57600" ) ); #endif } void WellenreiterConfigWindow::save() { #ifdef Q_WS_X11 #warning Persistent Configuration not yet implemented for standalone X11 build #else odebug << "saving configuration settings..." << oendl; /* This is dumb monkey typing stuff... We _need_ to do this automatically! */ OConfig* c = oApp->config(); diff --git a/noncore/settings/appearance2/appearance.cpp b/noncore/settings/appearance2/appearance.cpp index 9638686..088171c 100644 --- a/noncore/settings/appearance2/appearance.cpp +++ b/noncore/settings/appearance2/appearance.cpp @@ -42,49 +42,49 @@ #include <opie2/odebug.h> #include <qpe/config.h> #include <qpe/global.h> #include <qpe/qpeapplication.h> #include <qpe/qpemessagebox.h> #include <qpe/qcopenvelope_qws.h> #include <qpe/qpestyle.h> #include <qpe/lightstyle.h> #include <qpe/styleinterface.h> /* QT */ #include <qbuttongroup.h> #include <qcheckbox.h> #include <qcombobox.h> #include <qdialog.h> #include <qdir.h> #include <qlabel.h> #include <qlayout.h> #include <qlineedit.h> #include <qlistbox.h> #include <qmessagebox.h> #include <qpushbutton.h> #include <qradiobutton.h> -#if QT_VERSION >= 300 +#if QT_VERSION >= 0x030000 #include <qstylefactory.h> #endif #include <qtoolbutton.h> #include <qwindowsstyle.h> #include <qlistview.h> #include <qheader.h> #include <qvbox.h> #include <qwhatsthis.h> using namespace Opie; using namespace Opie::Ui; using namespace Opie::Core; class DefaultWindowDecoration : public WindowDecorationInterface { public: DefaultWindowDecoration() : ref(0) {} QString name() const { return "Default"; } QPixmap icon() const { return QPixmap(); @@ -109,49 +109,49 @@ private: QWidget *Appearance::createStyleTab ( QWidget *parent, Config &cfg ) { QWidget* tab = new QWidget( parent, "StyleTab" ); QVBoxLayout* vertLayout = new QVBoxLayout( tab, 3, 3 ); m_style_list = new QListBox( tab, "m_style_list" ); vertLayout->addWidget( m_style_list ); QWhatsThis::add( m_style_list, tr( "Styles control the way items such as buttons and scroll bars appear in all applications.\n\nClick here to select an available style." ) ); m_style_settings = new QPushButton ( tr( "Settings..." ), tab ); connect ( m_style_settings, SIGNAL( clicked()), this, SLOT( styleSettingsClicked())); vertLayout-> addWidget ( m_style_settings ); QWhatsThis::add( m_style_settings, tr( "Click here to configure the currently selected style.\n\nNote: This option is not available for all styles." ) ); QString s = cfg. readEntry ( "Style", "Light" ); -#if QT_VERSION >= 300 +#if QT_VERSION >= 0x030000 m_style_list->insertStringList(QStyleFactory::styles()); #else m_style_list-> insertItem ( new StyleListItem ( "Windows", new QWindowsStyle ( ))); m_style_list-> insertItem ( new StyleListItem ( "Light", new LightStyle ( ))); m_style_list-> insertItem ( new StyleListItem ( "QPE", new QPEStyle ( ))); #endif { QString path = QPEApplication::qpeDir ( ); path.append( "/plugins/styles/" ); QStringList sl = QDir ( path, "lib*.so" ). entryList ( ); for ( QStringList::Iterator it = sl. begin ( ); it != sl. end ( ); ++it ) { QString libstr = path; libstr.append( "/" ); libstr.append( *it ); QLibrary *lib = new QLibrary ( libstr ); StyleInterface *iface; if (( lib-> queryInterface ( IID_Style, (QUnknownInterface **) &iface ) == QS_OK ) && iface ) { StyleListItem *slit = new StyleListItem ( lib, iface ); m_style_list-> insertItem ( slit ); diff --git a/noncore/settings/doctab/doctab.cpp b/noncore/settings/doctab/doctab.cpp index feaf538..72eda6b 100644 --- a/noncore/settings/doctab/doctab.cpp +++ b/noncore/settings/doctab/doctab.cpp @@ -22,49 +22,49 @@ #include <qpe/global.h> #include <qpe/fontmanager.h> #include <qpe/config.h> #include <qpe/applnk.h> #include <qpe/qpedialog.h> #include <qpe/qpeapplication.h> #if defined(Q_WS_QWS) && !defined(QT_NO_COP) #include <qpe/qcopenvelope_qws.h> #endif #include <qlabel.h> #include <qcheckbox.h> #include <qradiobutton.h> #include <qtabwidget.h> #include <qslider.h> #include <qfile.h> #include <qtextstream.h> #include <qdatastream.h> #include <qmessagebox.h> #include <qcombobox.h> #include <qspinbox.h> #include <qlistbox.h> #include <qdir.h> -#if QT_VERSION >= 300 +#if QT_VERSION >= 0x030000 #include <qstylefactory.h> #endif #include <stdlib.h> DocTabSettings::DocTabSettings( QWidget* parent, const char* name, WFlags fl ) : DocTabSettingsBase( parent, name, TRUE, fl ) { dl = new QPEDialogListener(this); reset(); } DocTabSettings::~DocTabSettings() {} void DocTabSettings::accept() { applyDocTab(); QDialog::accept(); } void DocTabSettings::applyDocTab() { diff --git a/noncore/settings/language/language.cpp b/noncore/settings/language/language.cpp index 14750ac..bf90576 100644 --- a/noncore/settings/language/language.cpp +++ b/noncore/settings/language/language.cpp @@ -22,49 +22,49 @@ #include <qpe/global.h> #include <qpe/fontmanager.h> #include <qpe/config.h> #include <qpe/applnk.h> #include <qpe/qpedialog.h> #include <qpe/qpeapplication.h> #if defined(Q_WS_QWS) && !defined(QT_NO_COP) #include <qpe/qcopenvelope_qws.h> #endif #include <qlabel.h> #include <qcheckbox.h> #include <qradiobutton.h> #include <qtabwidget.h> #include <qslider.h> #include <qfile.h> #include <qtextstream.h> #include <qdatastream.h> #include <qmessagebox.h> #include <qcombobox.h> #include <qspinbox.h> #include <qlistbox.h> #include <qdir.h> -#if QT_VERSION >= 300 +#if QT_VERSION >= 0x030000 #include <qstylefactory.h> #endif #include <stdlib.h> LanguageSettings::LanguageSettings( QWidget* parent, const char* name, WFlags fl ) : LanguageSettingsBase( parent, name, TRUE, fl ) { if ( FontManager::hasUnicodeFont() ) languages->setFont(FontManager::unicodeFont(FontManager::Proportional)); QString tfn = QPEApplication::qpeDir() + "i18n/"; QDir langDir = tfn; QStringList list = langDir.entryList("*", QDir::Dirs ); QStringList::Iterator it; for ( it = list.begin(); it != list.end(); ++it ) { QString name = (*it); QFileInfo desktopFile( tfn + "/" + name + "/.directory" ); if ( desktopFile.exists() ) { langAvail.append(name); diff --git a/noncore/settings/networksettings/interfaces/module.h b/noncore/settings/networksettings/interfaces/module.h index 9dc913e..13189c3 100644 --- a/noncore/settings/networksettings/interfaces/module.h +++ b/noncore/settings/networksettings/interfaces/module.h @@ -1,29 +1,29 @@ #ifndef NETCONF_MODULE_H #define NETCONF_MODULE_H #include <qobject.h> -#if QT_VERSION < 300 +#if QT_VERSION < 0x030000 #include <qlist.h> #else #include <qptrlist.h> #endif #include <qmap.h> #include "interface.h" class QWidget; class QTabWidget; /** * \brief The basis of all plugins * * This is the way to extend networksettings with * extra functionality. * * * Networksettings in the 1.0 release does not use QCOM * for activation. You need to provide the following function yourself. * * A module needs to provide Name, Images, and methods for * claiming interfaces. For example you can claim physicla * interfaces like wlan0, ppp0 or virtual like a VPN diff --git a/noncore/settings/networksettings/mainwindow/addconnectionimp.cpp b/noncore/settings/networksettings/mainwindow/addconnectionimp.cpp index 84f1cf6..9049af4 100644 --- a/noncore/settings/networksettings/mainwindow/addconnectionimp.cpp +++ b/noncore/settings/networksettings/mainwindow/addconnectionimp.cpp @@ -1,27 +1,27 @@ #include "addconnectionimp.h" #include <qlistview.h> -#if QT_VERSION < 300 +#if QT_VERSION < 0x030000 #include <qlist.h> #else #include <qptrlist.h> #endif #include <qlabel.h> #include <qheader.h> /** * Constructor */ AddConnectionImp::AddConnectionImp(QWidget *parent, const char *name, WFlags f):AddConnection(parent, name, f){ connect(registeredServicesList, SIGNAL(selectionChanged()), this, SLOT(changed())); registeredServicesList->header()->hide(); }; /** * The current item changed, update the discription. */ void AddConnectionImp::changed(){ QListViewItem *item = registeredServicesList->currentItem(); if(item) help->setText(list[item->text(0)]); } diff --git a/noncore/settings/networksettings/mainwindow/mainwindowimp.cpp b/noncore/settings/networksettings/mainwindow/mainwindowimp.cpp index 5f23aea..8feb7a5 100644 --- a/noncore/settings/networksettings/mainwindow/mainwindowimp.cpp +++ b/noncore/settings/networksettings/mainwindow/mainwindowimp.cpp @@ -4,49 +4,49 @@ #include "interfaceinformationimp.h" #include "interfacesetupimp.h" #include "interfaces.h" #include "module.h" /* OPIE */ #include <opie2/odebug.h> #include <qpe/qcopenvelope_qws.h> #include <qpe/qpeapplication.h> #include <qpe/config.h> #include <qpe/qlibrary.h> #include <qpe/resource.h> /* QT */ #include <qpushbutton.h> #include <qlistbox.h> #include <qlineedit.h> #include <qlistview.h> #include <qheader.h> #include <qlabel.h> #include <qtabwidget.h> // in order to disable the profiles tab #include <qmessagebox.h> -#if QT_VERSION < 300 +#if QT_VERSION < 0x030000 #include <qlist.h> #else #include <qptrlist.h> #endif #include <qdir.h> #include <qfile.h> #include <qtextstream.h> #include <qregexp.h> /* STD */ #include <net/if.h> #include <sys/ioctl.h> #include <sys/socket.h> #define DEFAULT_SCHEME "/var/lib/pcmcia/scheme" #define _PROCNETDEV "/proc/net/dev" MainWindowImp::MainWindowImp(QWidget *parent, const char *name, WFlags) : MainWindow(parent, name, Qt::WStyle_ContextHelp), advancedUserMode(true), scheme(DEFAULT_SCHEME) { connect(addConnectionButton, SIGNAL(clicked()), this, SLOT(addClicked())); connect(removeConnectionButton, SIGNAL(clicked()), this, SLOT(removeClicked())); connect(informationConnectionButton, SIGNAL(clicked()), this, SLOT(informationClicked())); connect(configureConnectionButton, SIGNAL(clicked()), this, SLOT(configureClicked())); diff --git a/noncore/unsupported/qpdf/QOutputDev.cpp b/noncore/unsupported/qpdf/QOutputDev.cpp index 022d938..487177c 100644 --- a/noncore/unsupported/qpdf/QOutputDev.cpp +++ b/noncore/unsupported/qpdf/QOutputDev.cpp @@ -573,49 +573,49 @@ int QOutputDev::convertPath ( GfxState *state, QPointArray &points, QArray<int> // // Transform points in a single subpath and convert curves to line // segments. // int QOutputDev::convertSubpath ( GfxState *state, GfxSubpath *subpath, QPointArray &points ) { int oldcnt = points. count ( ); fp_t x0, y0, x1, y1, x2, y2, x3, y3; int m = subpath-> getNumPoints ( ); int i = 0; while ( i < m ) { if ( i >= 1 && subpath-> getCurve ( i )) { state-> transform ( subpath-> getX ( i - 1 ), subpath-> getY ( i - 1 ), &x0, &y0 ); state-> transform ( subpath-> getX ( i ), subpath-> getY ( i ), &x1, &y1 ); state-> transform ( subpath-> getX ( i + 1 ), subpath-> getY ( i + 1 ), &x2, &y2 ); state-> transform ( subpath-> getX ( i + 2 ), subpath-> getY ( i + 2 ), &x3, &y3 ); QPointArray tmp; tmp. setPoints ( 4, lrint ( x0 ), lrint ( y0 ), lrint ( x1 ), lrint ( y1 ), lrint ( x2 ), lrint ( y2 ), lrint ( x3 ), lrint ( y3 )); -#if QT_VERSION < 300 +#if QT_VERSION < 0x030000 tmp = tmp. quadBezier ( ); for ( uint loop = 0; loop < tmp. count ( ); loop++ ) { QPoint p = tmp. point ( loop ); points. putPoints ( points. count ( ), 1, p. x ( ), p. y ( )); } #else tmp = tmp. cubicBezier ( ); points. putPoints ( points. count ( ), tmp. count ( ), tmp ); #endif i += 3; } else { state-> transform ( subpath-> getX ( i ), subpath-> getY ( i ), &x1, &y1 ); points. putPoints ( points. count ( ), 1, lrint ( x1 ), lrint ( y1 )); ++i; } } return points. count ( ) - oldcnt; } diff --git a/scripts/kconfig/qconf.cc b/scripts/kconfig/qconf.cc index 52419ad..0459caf 100644 --- a/scripts/kconfig/qconf.cc +++ b/scripts/kconfig/qconf.cc @@ -1,57 +1,57 @@ /* * Copyright (C) 2002 Roman Zippel <zippel@linux-m68k.org> * Released under the terms of the GNU GPL v2.0. */ #include <qapplication.h> #include <qmainwindow.h> #include <qtoolbar.h> #include <qvbox.h> #include <qsplitter.h> #include <qlistview.h> #include <qtextview.h> #include <qlineedit.h> #include <qmenubar.h> #include <qmessagebox.h> #include <qaction.h> #include <qheader.h> #include <qfiledialog.h> #include <qregexp.h> -#if QT_VERSION >= 300 +#if QT_VERSION >= 0x030000 #include <qsettings.h> #endif #include <stdlib.h> #include "lkc.h" #include "qconf.h" #include "qconf.moc" #include "images.c" static QApplication *configApp; -#if QT_VERSION >= 300 +#if QT_VERSION >= 0x030000 static QSettings *configSettings; #endif /* * update all the children of a menu entry * removes/adds the entries from the parent widget as necessary * * parent: either the menu list widget or a menu entry widget * menu: entry to be updated */ template <class P> void ConfigList::updateMenuList(P* parent, struct menu* menu) { struct menu* child; ConfigItem* item; ConfigItem* last; bool visible; enum prop_type type; if (!menu) { while ((item = parent->firstChild())) delete item; return; } @@ -81,49 +81,49 @@ void ConfigList::updateMenuList(P* parent, struct menu* menu) if (!item || item->menu != child) item = new ConfigItem(parent, last, child, visible); else item->testUpdateMenu(visible); if (mode == fullMode || mode == menuMode || type != P_MENU) updateMenuList(item, child); else updateMenuList(item, 0); last = item; continue; } hide: if (item && item->menu == child) { last = parent->firstChild(); if (last == item) last = 0; else while (last->nextSibling() != item) last = last->nextSibling(); delete item; } } } -#if QT_VERSION >= 300 +#if QT_VERSION >= 0x030000 /* * set the new data * TODO check the value */ void ConfigItem::okRename(int col) { Parent::okRename(col); sym_set_string_value(menu->sym, text(dataColIdx).latin1()); } #endif /* * update the displayed of a menu entry */ void ConfigItem::updateMenu(void) { ConfigList* list; struct symbol* sym; struct property *prop; QString prompt; int type; tristate expr; list = listView(); @@ -194,49 +194,49 @@ void ConfigItem::updateMenu(void) default: if (sym_is_choice_value(sym) && type == S_BOOLEAN) setPixmap(promptColIdx, list->choiceNoPix); else setPixmap(promptColIdx, list->symbolNoPix); setText(noColIdx, "N"); ch = 'N'; break; } if (expr != no) setText(noColIdx, sym_tristate_within_range(sym, no) ? "_" : 0); if (expr != mod) setText(modColIdx, sym_tristate_within_range(sym, mod) ? "_" : 0); if (expr != yes) setText(yesColIdx, sym_tristate_within_range(sym, yes) ? "_" : 0); setText(dataColIdx, QChar(ch)); break; case S_INT: case S_HEX: case S_STRING: const char* data; data = sym_get_string_value(sym); -#if QT_VERSION >= 300 +#if QT_VERSION >= 0x030000 int i = list->mapIdx(dataColIdx); if (i >= 0) setRenameEnabled(i, TRUE); #endif setText(dataColIdx, data); if (type == S_STRING) prompt.sprintf("%s: %s", prompt.latin1(), data); else prompt.sprintf("(%s) %s", data, prompt.latin1()); break; } if (!sym_has_value(sym) && visible) prompt += " (NEW)"; set_prompt: setText(promptColIdx, prompt); } void ConfigItem::testUpdateMenu(bool v) { ConfigItem* i; visible = v; if (!menu) return; @@ -469,49 +469,49 @@ void ConfigList::changeValue(ConfigItem* item) if (!sym) { if (item->menu->list) item->setOpen(!item->isOpen()); return; } type = sym_get_type(sym); switch (type) { case S_BOOLEAN: case S_TRISTATE: oldexpr = sym_get_tristate_value(sym); newexpr = sym_toggle_tristate_value(sym); if (item->menu->list) { if (oldexpr == newexpr) item->setOpen(!item->isOpen()); else if (oldexpr == no) item->setOpen(TRUE); } if (oldexpr != newexpr) parent()->updateList(item); break; case S_INT: case S_HEX: case S_STRING: -#if QT_VERSION >= 300 +#if QT_VERSION >= 0x030000 if (colMap[dataColIdx] >= 0) item->startRename(colMap[dataColIdx]); else #endif parent()->lineEdit->show(item); break; } } void ConfigList::setRootMenu(struct menu *menu) { enum prop_type type; if (rootEntry == menu) return; type = menu && menu->prompt ? menu->prompt->type : P_UNKNOWN; if (type != P_MENU) return; updateMenuList(this, 0); rootEntry = menu; updateListAll(); setSelected(currentItem(), hasFocus()); } @@ -730,49 +730,49 @@ void ConfigView::updateList(ConfigItem* item) v->list->updateList(item); } void ConfigView::updateListAll(void) { ConfigView* v; for (v = viewList; v; v = v->nextView) v->list->updateListAll(); } /* * Construct the complete config widget */ ConfigMainWindow::ConfigMainWindow(void) { QMenuBar* menu; QSplitter* split1; QSplitter* split2; bool ok; int x, y, width, height; QWidget *d = configApp->desktop(); -#if QT_VERSION >= 300 +#if QT_VERSION >= 0x030000 width = configSettings->readNumEntry("/kconfig/qconf/window width", d->width() - 64); height = configSettings->readNumEntry("/kconfig/qconf/window height", d->height() - 64); resize(width, height); x = configSettings->readNumEntry("/kconfig/qconf/window x", 0, &ok); if (ok) y = configSettings->readNumEntry("/kconfig/qconf/window y", 0, &ok); if (ok) move(x, y); #else width = d->width() - 64; height = d->height() - 64; resize(width, height); #endif showDebug = false; split1 = new QSplitter(this); split1->setOrientation(QSplitter::Horizontal); setCentralWidget(split1); menuView = new ConfigView(split1, this); menuList = menuView->list; split2 = new QSplitter(split1); @@ -1245,60 +1245,60 @@ void fixup_rootmenu(struct menu *menu) } else if (!menu_cnt) fixup_rootmenu(child); } } static const char *progname; static void usage(void) { printf("%s <config>\n", progname); exit(0); } int main(int ac, char** av) { ConfigMainWindow* v; const char *name; #ifndef LKC_DIRECT_LINK kconfig_load(); #endif progname = av[0]; configApp = new QApplication(ac, av); -#if QT_VERSION >= 300 +#if QT_VERSION >= 0x030000 configSettings = new QSettings; #endif if (ac > 1 && av[1][0] == '-') { switch (av[1][1]) { case 'h': case '?': usage(); } name = av[2]; } else name = av[1]; if (!name) usage(); conf_parse(name); fixup_rootmenu(&rootmenu); conf_read(NULL); //zconfdump(stdout); v = new ConfigMainWindow(); //zconfdump(stdout); v->show(); configApp->connect(configApp, SIGNAL(lastWindowClosed()), SLOT(quit())); configApp->exec(); -#if QT_VERSION >= 300 +#if QT_VERSION >= 0x030000 configSettings->writeEntry("/kconfig/qconf/window x", v->pos().x()); configSettings->writeEntry("/kconfig/qconf/window y", v->pos().y()); configSettings->writeEntry("/kconfig/qconf/window width", v->size().width()); configSettings->writeEntry("/kconfig/qconf/window height", v->size().height()); delete configSettings; #endif return 0; } diff --git a/scripts/kconfig/qconf.h b/scripts/kconfig/qconf.h index c548884..dee5254 100644 --- a/scripts/kconfig/qconf.h +++ b/scripts/kconfig/qconf.h @@ -120,49 +120,49 @@ private: int colMap[colNr]; int colRevMap[colNr]; }; class ConfigItem : public QListViewItem { typedef class QListViewItem Parent; public: ConfigItem(QListView *parent, ConfigItem *after, struct menu *m, bool v) : Parent(parent, after), menu(m), visible(v), goParent(false) { init(); } ConfigItem(ConfigItem *parent, ConfigItem *after, struct menu *m, bool v) : Parent(parent, after), menu(m), visible(v), goParent(false) { init(); } ConfigItem(QListView *parent, ConfigItem *after, bool v) : Parent(parent, after), menu(0), visible(v), goParent(true) { init(); } ~ConfigItem(void); void init(void); -#if QT_VERSION >= 300 +#if QT_VERSION >= 0x030000 void okRename(int col); #endif void updateMenu(void); void testUpdateMenu(bool v); ConfigList* listView() const { return (ConfigList*)Parent::listView(); } ConfigItem* firstChild() const { return (ConfigItem *)Parent::firstChild(); } ConfigItem* nextSibling() const { return (ConfigItem *)Parent::nextSibling(); } void setText(colIdx idx, const QString& text) { Parent::setText(listView()->mapIdx(idx), text); } QString text(colIdx idx) const { return Parent::text(listView()->mapIdx(idx)); } |