Commit 0a1eb367 authored by Laurent Montel's avatar Laurent Montel 😁

KURL->KUrl

svn path=/trunk/KDE/kdeedu/kmplot/; revision=503131
parent 99829392
......@@ -123,7 +123,7 @@ MainDlg::~MainDlg()
void MainDlg::setupActions()
{
// standard actions
m_recentFiles = KStdAction::openRecent( this, SLOT( slotOpenRecent( const KURL& ) ), actionCollection(),"file_openrecent");
m_recentFiles = KStdAction::openRecent( this, SLOT( slotOpenRecent( const KUrl& ) ), actionCollection(),"file_openrecent");
KStdAction::print( this, SLOT( slotPrint() ), actionCollection(),"file_print" );
KStdAction::save( this, SLOT( slotSave() ), actionCollection() );
KStdAction::saveAs( this, SLOT( slotSaveas() ), actionCollection() );
......@@ -263,7 +263,7 @@ void MainDlg::slotSaveas()
{
if (m_readonly)
return;
const KURL url = KFileDialog::getSaveURL( QDir::currentPath(), i18n( "*.fkt|KmPlot Files (*.fkt)\n*|All Files" ), m_parent, i18n( "Save As" ) );
const KUrl url = KFileDialog::getSaveURL( QDir::currentPath(), i18n( "*.fkt|KmPlot Files (*.fkt)\n*|All Files" ), m_parent, i18n( "Save As" ) );
if ( !url.isEmpty() )
{
......@@ -276,7 +276,7 @@ void MainDlg::slotSaveas()
{
m_url = url;
m_recentFiles->addURL( url );
setWindowCaption( m_url.prettyURL(0, KURL::StripFileProtocol) );
setWindowCaption( m_url.prettyURL(0, KUrl::StripFileProtocol) );
m_modified = false;
}
return;
......@@ -286,7 +286,7 @@ void MainDlg::slotSaveas()
void MainDlg::slotExport()
{
KURL const url = KFileDialog::getSaveURL(QDir::currentPath(),
KUrl const url = KFileDialog::getSaveURL(QDir::currentPath(),
i18n("*.svg|Scalable Vector Graphics (*.svg)\n"
"*.bmp|Bitmap 180dpi (*.bmp)\n"
"*.png|Bitmap 180dpi (*.png)"), m_parent, i18n("Export") );
......@@ -300,7 +300,7 @@ void MainDlg::slotExport()
Q3Picture pic;
view->draw(&pic, 2);
if (url.isLocalFile() )
pic.save( url.prettyURL(0,KURL::StripFileProtocol), "SVG");
pic.save( url.prettyURL(0,KUrl::StripFileProtocol), "SVG");
else
{
KTempFile tmp;
......@@ -316,7 +316,7 @@ void MainDlg::slotExport()
QPixmap pic(100, 100);
view->draw(&pic, 3);
if (url.isLocalFile() )
pic.save( url.prettyURL(0,KURL::StripFileProtocol), "BMP");
pic.save( url.prettyURL(0,KUrl::StripFileProtocol), "BMP");
else
{
KTempFile tmp;
......@@ -332,7 +332,7 @@ void MainDlg::slotExport()
QPixmap pic(100, 100);
view->draw(&pic, 3);
if (url.isLocalFile() )
pic.save( url.prettyURL(0,KURL::StripFileProtocol), "PNG");
pic.save( url.prettyURL(0,KUrl::StripFileProtocol), "PNG");
else
{
KTempFile tmp;
......@@ -354,15 +354,15 @@ bool MainDlg::openFile()
return false;
}
m_currentfile = m_url;
m_recentFiles->addURL( m_url.prettyURL(0, KURL::StripFileProtocol) );
setWindowCaption( m_url.prettyURL(0, KURL::StripFileProtocol) );
m_recentFiles->addURL( m_url.prettyURL(0, KUrl::StripFileProtocol) );
setWindowCaption( m_url.prettyURL(0, KUrl::StripFileProtocol) );
m_modified = false;
view->updateSliders();
view->drawPlot();
return true;
}
void MainDlg::slotOpenRecent( const KURL &url )
void MainDlg::slotOpenRecent( const KUrl &url )
{
if( isModified() || !m_url.isEmpty() ) // open the file in a new window
{
......@@ -382,7 +382,7 @@ void MainDlg::slotOpenRecent( const KURL &url )
}
m_url = m_currentfile = url;
m_recentFiles->setCurrentItem(-1); //don't select the item in the open-recent menu
setWindowCaption( m_url.prettyURL(0, KURL::StripFileProtocol) );
setWindowCaption( m_url.prettyURL(0, KUrl::StripFileProtocol) );
m_modified = false;
view->updateSliders();
view->drawPlot();
......
......@@ -186,7 +186,7 @@ private:
/// MainDlg's parent widget
QWidget *m_parent;
/// Current file
KURL m_currentfile;
KUrl m_currentfile;
/// The axes config dialogs
CoordsConfigDialog* coordsDialog;
......@@ -195,7 +195,7 @@ protected slots:
* When you click on a File->Open Recent file, it'll open
* @param url name of the url to open
*/
void slotOpenRecent( const KURL &url );
void slotOpenRecent( const KUrl &url );
///Update settings when there is a change in the Configure KmPlot dialog
void updateSettings();
/**
......
......@@ -126,12 +126,12 @@ void KmPlot::slotUpdateFullScreen( bool checked)
}
}
bool KmPlot::load(const KURL& url)
bool KmPlot::load(const KUrl& url)
{
m_part->openURL( url );
if (m_part->url().isEmpty())
return false;
setCaption(url.prettyURL(0, KURL::StripFileProtocol));
setCaption(url.prettyURL(0, KUrl::StripFileProtocol));
return true;
}
......@@ -226,7 +226,7 @@ void KmPlot::fileOpen()
// this slot is called whenever the File->Open menu is selected,
// the Open shortcut is pressed (usually CTRL+O) or the Open toolbar
// button is clicked
KURL const url = KFileDialog::getOpenURL( QDir::currentPath(),
KUrl const url = KFileDialog::getOpenURL( QDir::currentPath(),
i18n( "*.fkt|KmPlot Files (*.fkt)\n*.*|All Files" ), this, i18n( "Open" ) );
if ( !url.isEmpty())
......@@ -242,7 +242,7 @@ void KmPlot::fileOpen()
}
}
void KmPlot::fileOpen(const KURL &url)
void KmPlot::fileOpen(const KUrl &url)
{
if ( !url.isEmpty())
{
......@@ -258,7 +258,7 @@ void KmPlot::fileOpen(const KURL &url)
}
void KmPlot::openFileInNewWindow(const KURL url)
void KmPlot::openFileInNewWindow(const KUrl url)
{
KToolInvocation::startServiceByDesktopName("kmplot",url.url());
}
......
......@@ -63,7 +63,7 @@ public:
/**
* Use this method to load whatever file/URL you have
*/
bool load(const KURL& url);
bool load(const KUrl& url);
protected:
/**
......@@ -85,7 +85,7 @@ protected:
private slots:
void fileNew();
void fileOpen();
void fileOpen(const KURL &url);
void fileOpen(const KUrl &url);
void optionsConfigureKeys();
void optionsConfigureToolbars();
void applyNewToolbarConfig();
......@@ -104,7 +104,7 @@ private:
void setupStatusBar();
bool checkModified();
bool isModified();
void openFileInNewWindow(const KURL url);
void openFileInNewWindow(const KUrl url);
/// Functions for the progressbar
bool stopProgressBar();
......
......@@ -42,12 +42,12 @@ k_dcop:
virtual void setStatusBarText(const QString &text, int id) = 0;
virtual void optionsConfigureKeys() = 0;
virtual void optionsConfigureToolbars() = 0;
virtual void openFileInNewWindow(const KURL url) = 0;
virtual void openFileInNewWindow(const KUrl url) = 0;
virtual bool stopProgressBar() = 0;
virtual void startProgressBar(int) = 0;
virtual void increaseProgressBar() = 0;
virtual void fileOpen(const KURL &url) = 0;
virtual void fileOpen(const KUrl &url) = 0;
};
......
......@@ -54,7 +54,7 @@ KmPlotIO::KmPlotIO( XParser *parser)
KmPlotIO::~KmPlotIO()
{}
bool KmPlotIO::save( const KURL &url )
bool KmPlotIO::save( const KUrl &url )
{
// saving as xml by a QDomDocument
QDomDocument doc( "kmpdoc" );
......@@ -201,7 +201,7 @@ bool KmPlotIO::save( const KURL &url )
}
else
{
xmlfile.setName(url.prettyURL(0,KURL::StripFileProtocol) );
xmlfile.setName(url.prettyURL(0,KUrl::StripFileProtocol) );
if (!xmlfile.open( QIODevice::WriteOnly ) )
return false;
QTextStream ts( &xmlfile );
......@@ -221,7 +221,7 @@ void KmPlotIO::addTag( QDomDocument &doc, QDomElement &parentTag, const QString
parentTag.appendChild( tag );
}
bool KmPlotIO::load( const KURL &url )
bool KmPlotIO::load( const KUrl &url )
{
QDomDocument doc( "kmpdoc" );
QFile f;
......@@ -241,7 +241,7 @@ bool KmPlotIO::load( const KURL &url )
f.setName(tmpfile);
}
else
f.setName( url.prettyURL(0,KURL::StripFileProtocol) );
f.setName( url.prettyURL(0,KUrl::StripFileProtocol) );
if ( !f.open( QIODevice::ReadOnly ) )
{
......
......@@ -49,13 +49,13 @@ class KmPlotIO
* in the filename file.
* @param url Name (URL) of the file which will be saved.
*/
bool save( const KURL &url );
bool save( const KUrl &url );
/**
* Read a kmpdoc xml file to restaure the settings of a previously saved plot
* @param url Name (URL) of file which will be opened
*/
bool load( const KURL &url );
bool load( const KUrl &url );
private:
/** Esay way to add a tag to the Dom tree
......
......@@ -135,7 +135,7 @@ void KParameterEditor::cmdDelete_clicked()
void KParameterEditor::cmdImport_clicked()
{
KURL url = KFileDialog::getOpenURL( QString(),i18n("*.txt|Plain Text File "));
KUrl url = KFileDialog::getOpenURL( QString(),i18n("*.txt|Plain Text File "));
if ( url.isEmpty() )
return;
......@@ -158,7 +158,7 @@ void KParameterEditor::cmdImport_clicked()
file.setName(tmpfile);
}
else
file.setName(url.prettyURL(0,KURL::StripFileProtocol) );
file.setName(url.prettyURL(0,KUrl::StripFileProtocol) );
if ( file.open(QIODevice::ReadOnly) )
{
......@@ -203,7 +203,7 @@ void KParameterEditor::cmdExport_clicked()
{
if ( !list->count() )
return;
KURL url = KFileDialog::getSaveURL( QString(),i18n("*.txt|Plain Text File "));
KUrl url = KFileDialog::getSaveURL( QString(),i18n("*.txt|Plain Text File "));
if ( url.isEmpty() )
return;
......@@ -244,7 +244,7 @@ void KParameterEditor::cmdExport_clicked()
}
else
{
file.setName(url.prettyURL(0,KURL::StripFileProtocol));
file.setName(url.prettyURL(0,KUrl::StripFileProtocol));
if (file.open( QIODevice::WriteOnly ) )
{
QTextStream stream(&file);
......
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