Commit 3c67be36 authored by David Saxton's avatar David Saxton

less qt3_support (patch from pino).

svn path=/trunk/KDE/kdeedu/kmplot/; revision=522624
parent 8d0f9eb0
......@@ -68,8 +68,8 @@ MainDlg::MainDlg(QWidget *parentWidget, const char *, QObject *parent ) : DCOPO
// we need an instance
setInstance( KmPlotPartFactory::instance() );
kDebug() << "parentWidget->name():" << parentWidget->name() << endl;
if ( QString(parentWidget->name()).startsWith("KmPlot") )
kDebug() << "parentWidget->objectName():" << parentWidget->objectName() << endl;
if ( QString(parentWidget->objectName()).startsWith("KmPlot") )
{
setXMLFile("kmplot_part.rc");
m_readonly = false;
......@@ -103,7 +103,8 @@ MainDlg::MainDlg(QWidget *parentWidget, const char *, QObject *parent ) : DCOPO
m_generalSettings = new SettingsPageGeneral( view );
m_colorSettings = new SettingsPageColor( view );
m_fontsSettings = new SettingsPageFonts( view );
m_constantsSettings = new KConstantEditor( view, 0, "constantsSettings" );
m_constantsSettings = new KConstantEditor( view, 0 );
m_constantsSettings->setObjectName( "constantsSettings" );
m_settingsDialog->addPage( m_generalSettings, i18n("General"), "package_settings", i18n("General Settings") );
m_settingsDialog->addPage( m_colorSettings, i18n("Colors"), "colorize", i18n("Colors") );
......@@ -377,7 +378,7 @@ void MainDlg::slotExport()
// check if file exists and overwriting is ok.
if( KIO::NetAccess::exists(url,false,m_parent ) && KMessageBox::warningContinueCancel( m_parent, i18n( "A file named \"%1\" already exists. Are you sure you want to continue and overwrite this file?" ).arg(url.url() ), i18n( "Overwrite File?" ), KGuiItem( i18n( "&Overwrite" ) ) ) != KMessageBox::Continue ) return;
if( url.fileName().right(4).lower()==".svg")
if( url.fileName().right(4).toLower()==".svg")
{
QPicture pic;
view->draw(&pic, 2);
......@@ -393,7 +394,7 @@ void MainDlg::slotExport()
}
}
else if( url.fileName().right(4).lower()==".bmp")
else if( url.fileName().right(4).toLower()==".bmp")
{
QPixmap pic(100, 100);
view->draw(&pic, 3);
......@@ -409,7 +410,7 @@ void MainDlg::slotExport()
}
}
else if( url.fileName().right(4).lower()==".png")
else if( url.fileName().right(4).toLower()==".png")
{
QPixmap pic(100, 100);
view->draw(&pic, 3);
......@@ -502,7 +503,9 @@ void MainDlg::editScaling()
// create a config dialog and add a scaling page
KConfigDialog *scalingDialog = new KConfigDialog( m_parent, "scaling", Settings::self() );
scalingDialog->setHelp("scaling-config");
scalingDialog->addPage( new EditScaling( 0, "scalingSettings" ), i18n( "Scale" ), "scaling", i18n( "Edit Scaling" ) );
EditScaling *es = new EditScaling();
es->setObjectName( "scalingSettings" );
scalingDialog->addPage( es, i18n( "Scale" ), "scaling", i18n( "Edit Scaling" ) );
// User edited the configuration - update your local copies of the
// configuration data
connect( scalingDialog, SIGNAL( settingsChanged(const QString &) ), this, SLOT(updateSettings() ) );
......@@ -580,7 +583,7 @@ void MainDlg::slotQuickEdit(const QString& f_str_const )
{
//creates a valid name for the function if the user has forgotten that
QString f_str( f_str_const );
int const pos = f_str_const.find(';');
int const pos = f_str_const.indexOf(';');
if (pos!=-1)
f_str = f_str.left(pos);
if (f_str.at(0)=='r')
......@@ -683,7 +686,7 @@ void MainDlg::loadConstants()
if ( tmp_constant == " " || tmp_constant == " ")
return;
constant = tmp_constant[0].upper().latin1();
constant = tmp_constant[0].toUpper().latin1();
if ( constant<'A' || constant>'Z')
constant = 'A';
......
......@@ -276,32 +276,32 @@ class QuickEditAction : public KAction, public QActionWidgetFactory
class EditScaling : public QWidget, public Ui::EditScaling
{
public:
EditScaling( QWidget * parent = 0, const char * name = 0 )
: QWidget( parent, name )
EditScaling( QWidget * parent = 0 )
: QWidget( parent )
{ setupUi(this); }
};
class SettingsPageColor : public QWidget, public Ui::SettingsPageColor
{
public:
SettingsPageColor( QWidget * parent = 0, const char * name = 0 )
: QWidget( parent, name )
SettingsPageColor( QWidget * parent = 0 )
: QWidget( parent )
{ setupUi(this); }
};
class SettingsPageFonts : public QWidget, public Ui::SettingsPageFonts
{
public:
SettingsPageFonts( QWidget * parent = 0, const char * name = 0 )
: QWidget( parent, name )
SettingsPageFonts( QWidget * parent = 0 )
: QWidget( parent )
{ setupUi(this); }
};
class SettingsPageGeneral : public QWidget, public Ui::SettingsPageGeneral
{
public:
SettingsPageGeneral( QWidget * parent = 0, const char * name = 0 )
: QWidget( parent, name )
SettingsPageGeneral( QWidget * parent = 0 )
: QWidget( parent )
{ setupUi(this); }
};
......
......@@ -1058,7 +1058,7 @@ void View::mousePressEvent(QMouseEvent *e)
else
m_popupmenushown = 2;
QString function = it->fstr;
function = function.left(function.find('(')) + '\'';
function = function.left(function.indexOf('(')) + '\'';
m_popupmenu->addTitle( function);
m_popupmenu->exec(QCursor::pos());
return;
......@@ -1075,7 +1075,7 @@ void View::mousePressEvent(QMouseEvent *e)
else
m_popupmenushown = 2;
QString function = it->fstr;
function = function.left(function.find('(')) + "\'\'";
function = function.left(function.indexOf('(')) + "\'\'";
m_popupmenu->addTitle(function);
m_popupmenu->exec(QCursor::pos());
return;
......@@ -1136,7 +1136,7 @@ void View::mousePressEvent(QMouseEvent *e)
csparam = k;
m_minmax->selectItem();
QString function = it->fstr;
function = function.left(function.find('(')) + '\'';
function = function.left(function.indexOf('(')) + '\'';
setStatusBar(function,4);
mouseMoveEvent(e);
return;
......@@ -1148,7 +1148,7 @@ void View::mousePressEvent(QMouseEvent *e)
csparam = k;
m_minmax->selectItem();
QString function = it->fstr;
function = function.left(function.find('(')) + "\'\'";
function = function.left(function.indexOf('(')) + "\'\'";
setStatusBar(function,4);
mouseMoveEvent(e);
return;
......@@ -1678,14 +1678,14 @@ void View::keyPressEvent( QKeyEvent * e)
case 1:
{
QString function = it->fstr;
function = function.left(function.find('(')) + '\'';
function = function.left(function.indexOf('(')) + '\'';
setStatusBar(function,4);
break;
}
case 2:
{
QString function = it->fstr;
function = function.left(function.find('(')) + "\'\'";
function = function.left(function.indexOf('(')) + "\'\'";
setStatusBar(function,4);
break;
}
......
......@@ -388,9 +388,9 @@ void EditFunction::slotHelp()
bool EditFunction::functionHas2Arguments()
{
int const openBracket = editfunctionpage->equation->text().find( "(" );
int const closeBracket = editfunctionpage->equation->text().find( ")" );
return editfunctionpage->equation->text().mid( openBracket+1, closeBracket-openBracket-1 ).find( "," ) != -1;
int const openBracket = editfunctionpage->equation->text().indexOf( "(" );
int const closeBracket = editfunctionpage->equation->text().indexOf( ")" );
return editfunctionpage->equation->text().mid( openBracket+1, closeBracket-openBracket-1 ).indexOf( "," ) != -1;
}
void EditFunction::cmdParameter_clicked()
{
......@@ -401,8 +401,8 @@ void EditFunction::cmdParameter_clicked()
void EditFunction::fixFunctionArguments(QString &f_str)
{
int const openBracket = f_str.find( "(" );
int const closeBracket = f_str.find( ")" );
int const openBracket = f_str.indexOf( "(" );
int const closeBracket = f_str.indexOf( ")" );
char parameter_name;
if ( closeBracket-openBracket == 2) //the function atribute is only one character
{
......
......@@ -40,8 +40,8 @@
#include "kconstanteditor.h"
KConstantEditor::KConstantEditor(View *v, QWidget *parent, const char *name)
: QWidget(parent,name),
KConstantEditor::KConstantEditor(View *v, QWidget *parent)
: QWidget(parent),
m_view(v)
{
setupUi( this );
......@@ -97,7 +97,7 @@ void KConstantEditor::cmdDelete_clicked()
for( QVector<Ufkt>::iterator it = m_view->parser()->ufkt.begin(); it != m_view->parser()->ufkt.end(); ++it)
{
str = it->fstr;
for (int i=str.find(')'); i<str.length();i++)
for (int i=str.indexOf(')'); i<str.length();i++)
if ( str.at(i) == constant )
{
KMessageBox::error(this, i18n("A function uses this constant; therefore, it cannot be removed."));
......
......@@ -38,7 +38,7 @@ class KConstantEditor : public QWidget, public Ui::SettingsPageConstants
{
Q_OBJECT
public:
KConstantEditor(View *, QWidget *parent = 0, const char *name = 0);
KConstantEditor(View *, QWidget *parent = 0);
~KConstantEditor();
public slots:
......
......@@ -98,7 +98,7 @@ void KEditConstant::accept()
void KEditConstant::nameChanged( const QString & newName )
{
m_mainWidget->txtConstant->setText( newName.upper() );
m_mainWidget->txtConstant->setText( newName.toUpper() );
}
#include "keditconstant.moc"
......
......@@ -123,7 +123,7 @@ void KEditParametric::accept()
{
QString fname;
m_parser->fixFunctionName(fname, XParser::ParametricX, m_x_id);
int const pos = fname.find('(');
int const pos = fname.indexOf('(');
m_editParametric->kLineEditName->setText(fname.mid(1,pos-1));
}
......@@ -317,7 +317,7 @@ void KEditParametric::splitEquation( const QString equation, QString &name, QStr
{
int start = 0;
if( equation[ 0 ] == 'x' || equation[ 0 ] == 'y' ) start++;
int length = equation.find( '(' ) - start;
int length = equation.indexOf( '(' ) - start;
name = equation.mid( start, length );
expression = equation.section( '=', 1, 1 );
......
......@@ -154,7 +154,7 @@ void KMinMax::updateFunctions()
if ( it->f1_mode ) //1st derivative
{
QString function (it->fstr);
int i= function.find('(');
int i= function.indexOf('(');
function.truncate(i);
function +="\'";
m_mainWidget->list->insertItem(function );
......@@ -162,7 +162,7 @@ void KMinMax::updateFunctions()
if ( it->f2_mode )//2nd derivative
{
QString function (it->fstr);
int i= function.find('(');
int i= function.indexOf('(');
function.truncate(i);
function +="\'\'";
m_mainWidget->list->insertItem(function );
......@@ -170,9 +170,9 @@ void KMinMax::updateFunctions()
if ( it->integral_mode )//integral
{
QString function (it->fstr);
int i= function.find('(');
int i= function.indexOf('(');
function.truncate(i);
function = function.upper();
function = function.toUpper();
m_mainWidget->list->insertItem(function );
}
}
......@@ -198,13 +198,13 @@ void KMinMax::selectItem()
QString function = ufkt->fstr;
if ( m_view->cstype == 2)
{
int i= function.find('(');
int i= function.indexOf('(');
function.truncate(i);
function +="\'\'";
}
else if ( m_view->cstype == 1)
{
int i= function.find('(');
int i= function.indexOf('(');
function.truncate(i);
function +="\'";
}
......@@ -267,19 +267,19 @@ void KMinMax::cmdFind_clicked()
if ( function.contains('\'') == 1)
{
p_mode = 1;
int pos = function.find('\'');
int pos = function.indexOf('\'');
function.remove(pos,1);
}
else if ( function.contains('\'') == 2)
{
p_mode = 2;
int pos = function.find('\'');
int pos = function.indexOf('\'');
function.remove(pos,2);
}
else if ( function.at(0).category() == QChar::Letter_Uppercase)
{
p_mode = 3;
function[0] = function[0].lower();
function[0] = function[0].toLower();
}
QString fname, fstr;
......@@ -361,19 +361,19 @@ void KMinMax::list_highlighted(Q3ListBoxItem* item)
if ( function.contains('\'') == 1)
{
p_mode = 1;
int pos = function.find('\'');
int pos = function.indexOf('\'');
function.remove(pos,1);
}
else if ( function.contains('\'') == 2)
{
p_mode = 2;
int pos = function.find('\'');
int pos = function.indexOf('\'');
function.remove(pos,2);
}
else if ( function.at(0).category() == QChar::Letter_Uppercase)
{
p_mode = 3;
function[0] = function[0].lower();
function[0] = function[0].toLower();
}
QString const sec_function = function.section('(',0,0);
for(QVector<Ufkt>::iterator it = m_view->parser()->ufkt.begin(); it!=m_view->parser()->ufkt.end(); ++it)
......@@ -399,19 +399,19 @@ void KMinMax::cmdParameter_clicked()
if ( function.contains('\'') == 1)
{
p_mode = 1;
int pos = function.find('\'');
int pos = function.indexOf('\'');
function.remove(pos,1);
}
else if ( function.contains('\'') == 2)
{
p_mode = 2;
int pos = function.find('\'');
int pos = function.indexOf('\'');
function.remove(pos,2);
}
else if ( function.at(0).category() == QChar::Letter_Uppercase)
{
p_mode = 3;
function[0] = function[0].lower();
function[0] = function[0].toLower();
}
QString const sec_function = function.section('(',0,0);
......
......@@ -182,10 +182,11 @@ bool KmPlotIO::save( const KUrl &url )
if (!url.isLocalFile() )
{
KTempFile tmpfile;
xmlfile.setName(tmpfile.name() );
xmlfile.setFileName( KUrl( tmpfile.name() ).path() );
if (!xmlfile.open( QIODevice::WriteOnly ) )
{
tmpfile.unlink();
kWarning() << k_funcinfo << "Could not open " << KUrl( tmpfile.name() ).path() << " for writing.\n";
return false;
}
QTextStream ts( &xmlfile );
......@@ -195,15 +196,19 @@ bool KmPlotIO::save( const KUrl &url )
if ( !KIO::NetAccess::upload(tmpfile.name(), url,0))
{
tmpfile.unlink();
kWarning() << k_funcinfo << "Could not open " << url.prettyURL() << " for writing ("<<KIO::NetAccess::lastErrorString()<<").\n";
return false;
}
tmpfile.unlink();
}
else
{
xmlfile.setName(url.prettyURL(0) );
xmlfile.setFileName(url.path() );
if (!xmlfile.open( QIODevice::WriteOnly ) )
{
kWarning() << k_funcinfo << "Could not open " << url.path() << " for writing.\n";
return false;
}
QTextStream ts( &xmlfile );
doc.save( ts, 4 );
xmlfile.close();
......@@ -238,10 +243,10 @@ bool KmPlotIO::load( const KUrl &url )
KMessageBox::error(0,i18n("An error appeared when opening this file"));
return false;
}
f.setName(tmpfile);
f.setFileName(tmpfile);
}
else
f.setName( url.prettyURL(0) );
f.setFileName( url.path() );
if ( !f.open( QIODevice::ReadOnly ) )
{
......@@ -292,7 +297,7 @@ bool KmPlotIO::load( const KUrl &url )
KMessageBox::error(0,i18n("The file had an unknown version number"));
if ( !url.isLocalFile() )
KIO::NetAccess::removeTempFile( f.name() );
KIO::NetAccess::removeTempFile( f.fileName() );
return true;
}
......@@ -438,7 +443,7 @@ void KmPlotIO::parseFunction( XParser *m_parser, const QDomElement & n )
QString fstr = ufkt.fstr;
if ( !fstr.isEmpty() )
{
int const i = fstr.find( ';' );
int const i = fstr.indexOf( ';' );
QString str;
if ( i == -1 )
str = fstr;
......@@ -533,7 +538,7 @@ void KmPlotIO::oldParseFunction( XParser *m_parser, const QDomElement & n )
}
const QString tmp_fstr = n.namedItem( "equation" ).toElement().text();
const int pos = tmp_fstr.find(';');
const int pos = tmp_fstr.indexOf(';');
if ( pos == -1 )
ufkt.fstr = tmp_fstr;
else
......@@ -549,7 +554,7 @@ void KmPlotIO::oldParseFunction( XParser *m_parser, const QDomElement & n )
QString fstr = ufkt.fstr;
if ( !fstr.isEmpty() )
{
int const i = fstr.find( ';' );
int const i = fstr.indexOf( ';' );
QString str;
if ( i == -1 )
str = fstr;
......
......@@ -29,7 +29,7 @@
#include "kmplotprogress.h"
//#include "kmplotprogress.moc.cpp"
KmPlotProgress::KmPlotProgress( QWidget* parent, const char* name ) : QWidget( parent, name)
KmPlotProgress::KmPlotProgress( QWidget* parent ) : QWidget( parent )
{
button = new KPushButton(this);
button->setPixmap( SmallIcon( "cancel" ) );
......
......@@ -34,7 +34,7 @@ class KmPlotProgress: public QWidget
{
Q_OBJECT
public:
KmPlotProgress( QWidget* parent = 0, const char* name = 0 );
KmPlotProgress( QWidget* parent = 0 );
~KmPlotProgress();
void increase();
......
......@@ -166,10 +166,10 @@ void KParameterEditor::cmdImport_clicked()
KMessageBox::error(0,i18n("An error appeared when opening this file"));
return;
}
file.setName(tmpfile);
file.setFileName(tmpfile);
}
else
file.setName(url.prettyURL(0) );
file.setFileName(url.prettyURL(0) );
if ( file.open(QIODevice::ReadOnly) )
{
......@@ -225,7 +225,7 @@ void KParameterEditor::cmdExport_clicked()
if ( !url.isLocalFile() )
{
KTempFile tmpfile;
file.setName(tmpfile.name() );
file.setFileName(tmpfile.name() );
if (file.open( QIODevice::WriteOnly ) )
{
......@@ -255,7 +255,7 @@ void KParameterEditor::cmdExport_clicked()
}
else
{
file.setName(url.prettyURL(0));
file.setFileName(url.prettyURL(0));
if (file.open( QIODevice::WriteOnly ) )
{
QTextStream stream(&file);
......
......@@ -73,7 +73,7 @@ KSliderWindow::KSliderWindow( QWidget * parent, KActionCollection * ac ) :
m_sliders[i]->setMinimum( config.readEntry( "min", 0) );
m_sliders[i]->setMaximum( config.readEntry( "max", 100) );
m_sliders[i]->setValue( config.readEntry( "value", 50) );
m_sliders[i]->setPageStep( (int)ceil((abs(m_sliders[i]->minValue()) + abs(m_sliders[i]->maxValue()))/10.) );
m_sliders[i]->setPageStep( (int)ceil((abs(m_sliders[i]->minimum()) + abs(m_sliders[i]->maximum()))/10.) );
m_sliders[i]->installEventFilter(this);
......@@ -101,8 +101,8 @@ KSliderWindow::~KSliderWindow()
for ( unsigned i = 0; i < SLIDER_COUNT; ++i )
{
config.setGroup( "slider" + QString::number(i) );
config.writeEntry( "min", m_sliders[i]->minValue() );
config.writeEntry( "max", m_sliders[i]->maxValue() );
config.writeEntry( "min", m_sliders[i]->minimum() );
config.writeEntry( "max", m_sliders[i]->maximum() );
config.writeEntry( "value", m_sliders[i]->value() );
}
}
......@@ -144,11 +144,11 @@ void KSliderWindow::mnuMinValue_clicked()
assert( m_clickedOnSlider );
bool ok;
int const result = KInputDialog::getInteger(i18n("Change Minimum Value"), i18n("Type a new minimum value for the slider:"), m_clickedOnSlider->minValue(), INT_MIN, INT_MAX, 1, 10, &ok);
int const result = KInputDialog::getInteger(i18n("Change Minimum Value"), i18n("Type a new minimum value for the slider:"), m_clickedOnSlider->minimum(), INT_MIN, INT_MAX, 1, 10, &ok);
if (!ok)
return;
m_clickedOnSlider->setMinimum(result);
m_clickedOnSlider->setPageStep( (int)ceil((abs(m_clickedOnSlider->maxValue()) + abs(result))/10.) );
m_clickedOnSlider->setPageStep( (int)ceil((abs(m_clickedOnSlider->maximum()) + abs(result))/10.) );
setFocus();
}
......@@ -157,11 +157,11 @@ void KSliderWindow::mnuMaxValue_clicked()
assert( m_clickedOnSlider );
bool ok;
int const result = KInputDialog::getInteger(i18n("Change Maximum Value"), i18n("Type a new maximum value for the slider:"), m_clickedOnSlider->maxValue(), INT_MIN, INT_MAX, 1, 10, &ok);
int const result = KInputDialog::getInteger(i18n("Change Maximum Value"), i18n("Type a new maximum value for the slider:"), m_clickedOnSlider->maximum(), INT_MIN, INT_MAX, 1, 10, &ok);
if (!ok)
return;
m_clickedOnSlider->setMaximum(result);
m_clickedOnSlider->setPageStep( (int)ceil((abs(m_clickedOnSlider->minValue()) + abs(result))/10.) );
m_clickedOnSlider->setPageStep( (int)ceil((abs(m_clickedOnSlider->minimum()) + abs(result))/10.) );
setFocus();
}
......
......@@ -349,9 +349,9 @@ int Parser::addfkt(QString str)
stkptr=stack=0;
err=0;
errpos=1;
const int p1=str.find('(');
int p2=str.find(',');
const int p3=str.find(")=");
const int p1=str.indexOf('(');
int p2=str.indexOf(',');
const int p3=str.indexOf(")=");
fix_expression(str,p1+4);
if(p1==-1 || p3==-1 || p1>p3)
......@@ -404,7 +404,7 @@ int Parser::addfkt(QString str)
kDebug() << "temp.id:" << temp->id << endl;
if ( temp->fname != temp->fname.lower() ) //isn't allowed to contain capital letters
if ( temp->fname != temp->fname.toLower() ) //isn't allowed to contain capital letters
{
delfkt(temp);
err=12;
......@@ -438,9 +438,9 @@ void Parser::reparse(Ufkt *item)
err=0;
errpos=1;
const int p1=str.find('(');
int p2=str.find(',');
const int p3=str.find(")=");
const int p1=str.indexOf('(');
int p2=str.indexOf(',');
const int p3=str.indexOf(")=");
fix_expression(str,p1+4);
......@@ -464,7 +464,7 @@ void Parser::reparse(Ufkt *item)
if(p2<p3) item->fpar=str.mid(p2+1, p3-p2-1);
else item->fpar="";
if ( item->fname != item->fname.lower() ) //isn't allowed to contain capital letters
if ( item->fname != item->fname.toLower() ) //isn't allowed to contain capital letters
{
err=12;
return;
......
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