Members of the KDE Community are recommended to subscribe to the kde-community mailing list at https://mail.kde.org/mailman/listinfo/kde-community to allow them to participate in important discussions and receive other important announcements

Commit ff535910 authored by Martin Pfeiffer's avatar Martin Pfeiffer

removed a lot of deprecated warnings

svn path=/trunk/koffice/; revision=542503
parent 59d9a344
...@@ -20,10 +20,7 @@ ...@@ -20,10 +20,7 @@
#include <kapplication.h> #include <kapplication.h>
#include <klocale.h> #include <klocale.h>
#include <QLayout> #include <QVBoxLayout>
#include <q3vbox.h>
//Added by qt3to4:
#include <Q3VBoxLayout>
#include <kdebug.h> #include <kdebug.h>
#include <QLabel> #include <QLabel>
#include <QComboBox> #include <QComboBox>
...@@ -131,26 +128,26 @@ void KoInsertLinkDia::setHrefLinkName(const QString &_href, const QString &_link ...@@ -131,26 +128,26 @@ void KoInsertLinkDia::setHrefLinkName(const QString &_href, const QString &_link
slotTextChanged ( ); slotTextChanged ( );
} }
return; return;
} }
if(_href.find("http://")!=-1 || _href.find("https://")!=-1 ||_href.find("ftp://")!=-1 ) if( _href.contains("http://") || _href.contains("https://") || _href.contains("ftp://") )
{ {
internetLink->setHrefName(_href); internetLink->setHrefName(_href);
internetLink->setLinkName(_link); internetLink->setLinkName(_link);
showPage(0); showPage(0);
} }
else if(_href.find("file:/")!=-1) else if( _href.contains("file:/") )
{ {
fileLink->setHrefName(_href); fileLink->setHrefName(_href);
fileLink->setLinkName(_link); fileLink->setLinkName(_link);
showPage(2); showPage(2);
} }
else if(_href.find("mailto:")!=-1 || _href.find("news:")!=-1) else if( _href.contains("mailto:") || _href.contains("news:") )
{ {
mailLink->setHrefName(_href); mailLink->setHrefName(_href);
mailLink->setLinkName(_link); mailLink->setLinkName(_link);
showPage(1); showPage(1);
} }
else if(_href.find("bkm://")!=-1) else if( _href.contains("bkm://") )
{ {
if ( bookmarkLink ) if ( bookmarkLink )
{ {
...@@ -220,13 +217,14 @@ void KoInsertLinkDia::slotOk() ...@@ -220,13 +217,14 @@ void KoInsertLinkDia::slotOk()
} }
internetLinkPage::internetLinkPage( QWidget *parent , char *name ) internetLinkPage::internetLinkPage( QWidget *parent , char* /*name*/ )
: QWidget(parent,name) : QWidget(parent)
{ {
Q3VBoxLayout *lay1 = new Q3VBoxLayout( this ); QVBoxLayout *lay1 = new QVBoxLayout( this );
lay1->setSpacing( KDialog::spacingHint() ); lay1->setSpacing( KDialog::spacingHint() );
Q3VBoxLayout *lay2 = new Q3VBoxLayout( lay1); QVBoxLayout *lay2 = new QVBoxLayout();
lay2->setSpacing( KDialog::spacingHint() ); lay2->setSpacing( KDialog::spacingHint() );
lay1->addLayout( lay2 );
QLabel* tmpQLabel = new QLabel( this); QLabel* tmpQLabel = new QLabel( this);
...@@ -262,7 +260,7 @@ QString internetLinkPage::createInternetLink() ...@@ -262,7 +260,7 @@ QString internetLinkPage::createInternetLink()
if(result.isEmpty()) if(result.isEmpty())
return result; return result;
if(result.find("http://")==-1 && result.find("https://")==-1 && result.find("ftp://")==-1) if( !result.contains("http://") && !result.contains("https://") && !result.contains("ftp://") )
result = "http://"+result; result = "http://"+result;
return result; return result;
} }
...@@ -293,13 +291,14 @@ void internetLinkPage::textChanged ( const QString & ) ...@@ -293,13 +291,14 @@ void internetLinkPage::textChanged ( const QString & )
emit textChanged(); emit textChanged();
} }
bookmarkLinkPage::bookmarkLinkPage( QWidget *parent , char *name ) bookmarkLinkPage::bookmarkLinkPage( QWidget *parent , char* /*name*/ )
: QWidget(parent,name) : QWidget(parent)
{ {
Q3VBoxLayout *lay1 = new Q3VBoxLayout( this ); QVBoxLayout *lay1 = new QVBoxLayout( this );
lay1->setSpacing( KDialog::spacingHint() ); lay1->setSpacing( KDialog::spacingHint() );
Q3VBoxLayout *lay2 = new Q3VBoxLayout( lay1); QVBoxLayout *lay2 = new QVBoxLayout();
lay2->setSpacing( KDialog::spacingHint() ); lay2->setSpacing( KDialog::spacingHint() );
lay1->addLayout( lay2 );
QLabel* tmpQLabel = new QLabel( this); QLabel* tmpQLabel = new QLabel( this);
...@@ -335,7 +334,7 @@ QString bookmarkLinkPage::createBookmarkLink() ...@@ -335,7 +334,7 @@ QString bookmarkLinkPage::createBookmarkLink()
if(result.isEmpty()) if(result.isEmpty())
return result; return result;
if(result.find("bkm://")==-1) if( !result.contains("bkm://") )
result = "bkm://"+result; result = "bkm://"+result;
return result; return result;
} }
...@@ -348,13 +347,13 @@ void bookmarkLinkPage::setLinkName(const QString & _name) ...@@ -348,13 +347,13 @@ void bookmarkLinkPage::setLinkName(const QString & _name)
void bookmarkLinkPage::setHrefName(const QString &_name) void bookmarkLinkPage::setHrefName(const QString &_name)
{ {
m_hrefName->setCurrentText(_name); m_hrefName->setItemText( m_hrefName->currentIndex(), _name );
} }
void bookmarkLinkPage::setBookmarkList(const QStringList & bkmlist) void bookmarkLinkPage::setBookmarkList(const QStringList & bkmlist)
{ {
m_hrefName->clear(); m_hrefName->clear();
m_hrefName->insertStringList(bkmlist, 0); m_hrefName->insertItems( 0, bkmlist );
if ( bkmlist.isEmpty()) if ( bkmlist.isEmpty())
m_linkName->setEnabled( false); m_linkName->setEnabled( false);
//m_hrefName->setEditable(true); //m_hrefName->setEditable(true);
...@@ -375,13 +374,14 @@ void bookmarkLinkPage::textChanged ( const QString & ) ...@@ -375,13 +374,14 @@ void bookmarkLinkPage::textChanged ( const QString & )
emit textChanged(); emit textChanged();
} }
mailLinkPage::mailLinkPage( QWidget *parent , char *name ) mailLinkPage::mailLinkPage( QWidget *parent , char* /*name*/ )
: QWidget(parent,name) : QWidget(parent)
{ {
Q3VBoxLayout *lay1 = new Q3VBoxLayout( this ); QVBoxLayout *lay1 = new QVBoxLayout( this );
lay1->setSpacing( KDialog::spacingHint() ); lay1->setSpacing( KDialog::spacingHint() );
Q3VBoxLayout *lay2 = new Q3VBoxLayout( lay1); QVBoxLayout *lay2 = new QVBoxLayout();
lay2->setSpacing( KDialog::spacingHint() ); lay2->setSpacing( KDialog::spacingHint() );
lay1->addLayout( lay2 );
QLabel* tmpQLabel = new QLabel( this); QLabel* tmpQLabel = new QLabel( this);
...@@ -414,7 +414,7 @@ QString mailLinkPage::createMailLink() ...@@ -414,7 +414,7 @@ QString mailLinkPage::createMailLink()
if(result.isEmpty()) if(result.isEmpty())
return result; return result;
if(result.find("mailto:")==-1 && result.find("news:")==-1) if( !result.contains("mailto:") && !result.contains("news:") )
result = "mailto:"+result; result = "mailto:"+result;
return result; return result;
} }
...@@ -445,13 +445,14 @@ void mailLinkPage::textChanged ( const QString & ) ...@@ -445,13 +445,14 @@ void mailLinkPage::textChanged ( const QString & )
emit textChanged(); emit textChanged();
} }
fileLinkPage::fileLinkPage( QWidget *parent , char *name ) fileLinkPage::fileLinkPage( QWidget *parent , char* /*name*/ )
: QWidget(parent,name) : QWidget(parent)
{ {
Q3VBoxLayout *lay1 = new Q3VBoxLayout( this ); QVBoxLayout *lay1 = new QVBoxLayout( this );
lay1->setSpacing( KDialog::spacingHint() ); lay1->setSpacing( KDialog::spacingHint() );
Q3VBoxLayout *lay2 = new Q3VBoxLayout( lay1); QVBoxLayout *lay2 = new QVBoxLayout();
lay2->setSpacing( KDialog::spacingHint() ); lay2->setSpacing( KDialog::spacingHint() );
lay1->addLayout( lay2 );
QLabel* tmpQLabel = new QLabel( this); QLabel* tmpQLabel = new QLabel( this);
...@@ -481,11 +482,11 @@ fileLinkPage::fileLinkPage( QWidget *parent , char *name ) ...@@ -481,11 +482,11 @@ fileLinkPage::fileLinkPage( QWidget *parent , char *name )
if ( lst.count()<= 1 ) if ( lst.count()<= 1 )
{ {
recentFile->clear(); recentFile->clear();
recentFile->insertItem( i18n("No Entries") ); recentFile->addItem( i18n("No Entries") );
recentFile->setEnabled( false ); recentFile->setEnabled( false );
} }
else else
recentFile->insertStringList( lst); recentFile->addItems( lst );
recentFile->setSizePolicy( QSizePolicy::Expanding, QSizePolicy::Fixed ); recentFile->setSizePolicy( QSizePolicy::Expanding, QSizePolicy::Fixed );
...@@ -519,7 +520,7 @@ QString fileLinkPage::createFileLink() ...@@ -519,7 +520,7 @@ QString fileLinkPage::createFileLink()
if(result.isEmpty()) if(result.isEmpty())
return result; return result;
if(result.find("file:/")==-1) if( !result.contains("file:/") )
result = "file://"+result; result = "file://"+result;
return result; return result;
} }
......
...@@ -23,10 +23,8 @@ ...@@ -23,10 +23,8 @@
#include <QToolTip> #include <QToolTip>
#include <QCursor> #include <QCursor>
#include <QPainter> #include <QPainter>
#include <qdrawutil.h>
#include <QStyle> #include <QStyle>
#include <QStyleOptionToolButton> #include <QStyleOptionToolButton>
//Added by qt3to4:
#include <QPixmap> #include <QPixmap>
#include <QEvent> #include <QEvent>
...@@ -46,7 +44,7 @@ public: ...@@ -46,7 +44,7 @@ public:
TKToolBarButtonPrivate() TKToolBarButtonPrivate()
{ {
m_iconMode = TK::IconOnly; m_iconMode = TK::IconOnly;
m_isPopup = false; m_isPopup = false;
m_isToggle = false; m_isToggle = false;
m_isOn = false; m_isOn = false;
m_isRaised = false; m_isRaised = false;
...@@ -113,8 +111,8 @@ TKToolBarButton::TKToolBarButton( const QString& icon, const QString& txt, ...@@ -113,8 +111,8 @@ TKToolBarButton::TKToolBarButton( const QString& icon, const QString& txt,
modeChange(); modeChange();
} }
TKToolBarButton::TKToolBarButton( const QPixmap& pixmap, const QString& txt, QWidget* parent, const char* name ) TKToolBarButton::TKToolBarButton( const QPixmap& pixmap, const QString& txt, QWidget* parent, const char* /*name*/ )
: QToolButton(parent,name ) : QToolButton(parent )
{ {
d = new TKToolBarButtonPrivate; d = new TKToolBarButtonPrivate;
d->m_text = txt; d->m_text = txt;
...@@ -127,7 +125,7 @@ TKToolBarButton::TKToolBarButton( const QPixmap& pixmap, const QString& txt, QWi ...@@ -127,7 +125,7 @@ TKToolBarButton::TKToolBarButton( const QPixmap& pixmap, const QString& txt, QWi
installEventFilter(this); installEventFilter(this);
setPixmap(pixmap); QToolButton::setIcon( QIcon(pixmap) );
modeChange(); modeChange();
} }
...@@ -179,7 +177,7 @@ void TKToolBarButton::setEnabled( bool enabled ) ...@@ -179,7 +177,7 @@ void TKToolBarButton::setEnabled( bool enabled )
if (isEnabled()==enabled) if (isEnabled()==enabled)
return; return;
QToolButton::setPixmap( (enabled ? defaultPixmap : disabledPixmap) ); QToolButton::setIcon( QPixmap((enabled ? defaultPixmap : disabledPixmap)) );
QToolButton::setEnabled( enabled ); QToolButton::setEnabled( enabled );
} }
...@@ -306,13 +304,13 @@ void TKToolBarButton::enterEvent(QEvent *) ...@@ -306,13 +304,13 @@ void TKToolBarButton::enterEvent(QEvent *)
{ {
if (!d->m_isToggle) { if (!d->m_isToggle) {
if (isEnabled()) { if (isEnabled()) {
QToolButton::setPixmap(activePixmap); QToolButton::setIcon( QPixmap( activePixmap ) );
if (d->m_autoRaised) if (d->m_autoRaised)
setRaised(true); setRaised(true);
} else { } else {
QToolButton::setPixmap(disabledPixmap); QToolButton::setIcon( QPixmap( disabledPixmap ) );
} }
repaint(false); update();
} }
} }
...@@ -386,7 +384,7 @@ void TKToolBarButton::drawButton( QPainter* p ) ...@@ -386,7 +384,7 @@ void TKToolBarButton::drawButton( QPainter* p )
{ {
QStyle::State flags = QStyle::State_None; QStyle::State flags = QStyle::State_None;
if (isEnabled()) flags |= QStyle::State_Enabled; if (isEnabled()) flags |= QStyle::State_Enabled;
if (isOn()) flags |= QStyle::State_On; if (isChecked()) flags |= QStyle::State_On;
if (d->m_isRaised) flags |= QStyle::State_Raised; if (d->m_isRaised) flags |= QStyle::State_Raised;
if (hasFocus()) flags |= QStyle::State_HasFocus; if (hasFocus()) flags |= QStyle::State_HasFocus;
...@@ -417,10 +415,10 @@ void TKToolBarButton::paletteChange(const QPalette &) ...@@ -417,10 +415,10 @@ void TKToolBarButton::paletteChange(const QPalette &)
{ {
makeDisabledPixmap(); makeDisabledPixmap();
if ( !isEnabled() ) if ( !isEnabled() )
QToolButton::setPixmap( disabledPixmap ); QToolButton::setIcon( QIcon( disabledPixmap ) );
else else
QToolButton::setPixmap( defaultPixmap ); QToolButton::setIcon( QIcon( defaultPixmap ) );
repaint(false); update();
} }
void TKToolBarButton::makeDefaultPixmap() void TKToolBarButton::makeDefaultPixmap()
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment