[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-commits
Subject:    koffice
From:       David Faure <faure () kde ! org>
Date:       2006-09-01 11:50:36
Message-ID: 1157111436.070595.14561.nullmailer () svn ! kde ! org
[Download RAW message or body]

SVN commit 579647 by dfaure:

Fix string/url confusions


 M  +4 -4      filters/kspread/html/exportdialog.cc  
 M  +2 -2      filters/kspread/html/exportdialog.h  
 M  +1 -1      filters/kspread/html/htmlexport.cc  
 M  +9 -9      filters/kspread/latex/export/kspreadlatexexportdiaImpl.cc  
 M  +3 -3      filters/kword/html/export/ExportDialog.cc  
 M  +6 -4      kpresenter/KPrEffectDia.cpp  
 M  +2 -2      kpresenter/KPrMSPresentationSetup.cpp  
 M  +0 -2      kpresenter/KPrPage.h  
 M  +3 -2      kpresenter/KPrSlideTransitionDia.cpp  
 M  +3 -4      kpresenter/KPrTransEffectDia.cpp  
 M  +3 -3      kpresenter/KPrWebPresentation.cpp  


--- trunk/koffice/filters/kspread/html/exportdialog.cc #579646:579647
@@ -82,13 +82,13 @@
   return m_mainwidget->mSeparateFiles->isChecked();
 }
 
-QString ExportDialog::customStyleURL() const
+KUrl ExportDialog::customStyleURL() const
 {
-  QString url = m_mainwidget->mCustomURL->url();
-  if( m_mainwidget->mCustomButton->isChecked() && KUrl( url ).isValid() )
+  KUrl url = m_mainwidget->mCustomURL->url();
+  if( m_mainwidget->mCustomButton->isChecked() && url.isValid() )
     return url;
 
-  return QString::null;
+  return KUrl();
 }
 
 void ExportDialog::setSheets( const QStringList &list )
--- trunk/koffice/filters/kspread/html/exportdialog.h #579646:579647
@@ -41,9 +41,9 @@
 
     /**
       Returns a valid URL if the custom button was selected.
-      Else, it will return QString::null.
+      Else, it will return KUrl().
     */
-    QString customStyleURL() const;
+    KUrl customStyleURL() const;
 
     /**
       Returns true if borders should be shown, false if borders
--- trunk/koffice/filters/kspread/html/htmlexport.cc #579646:579647
@@ -197,7 +197,7 @@
   if( !m_dialog->customStyleURL().isEmpty() )
   {
     str += "<link ref=\"stylesheet\" type=\"text/css\" href=\"";
-    str += m_dialog->customStyleURL();
+    str += m_dialog->customStyleURL().url();
     str += "\" title=\"Style\" >\n";
   }
 
--- trunk/koffice/filters/kspread/latex/export/kspreadlatexexportdiaImpl.cc \
#579646:579647 @@ -55,7 +55,7 @@
  *  The dialog will by default be modeless, unless you set 'modal' to
  *  TRUE to construct a modal dialog.
  */
-KSpreadLatexExportDiaImpl::KSpreadLatexExportDiaImpl(KoStore* in, QWidget* parent, 
+KSpreadLatexExportDiaImpl::KSpreadLatexExportDiaImpl(KoStore* in, QWidget* parent,
 		const char* name_, bool modal, Qt::WFlags fl )
     : LatexExportDia( parent, name_, modal, fl ), _in( in )
 {
@@ -84,8 +84,8 @@
 	new LatexExportAdaptor(this);
     QDBusConnection::sessionBus().registerObject("/filter/latex", this);
 
-	
-	/* All these items inserted must not be translated so they are inserted here 
+
+	/* All these items inserted must not be translated so they are inserted here
 	 * without i18n() method. */
 	/*qualityComboBox->insertItem("final");
   qualityComboBox->insertItem("draft");*/
@@ -175,7 +175,7 @@
 	hide();
 	kDebug(30522) << "KSPREAD LATEX EXPORT FILTER --> BEGIN" << endl;
 	Config* config = Config::instance();
-	
+
 	/* Document tab */
 	if(embededButton == typeGroup->selected())
 		config->setEmbeded(true);
@@ -193,12 +193,12 @@
 	else
 		config->setQuality("draft");
 	config->setDefaultFontSize(defaultFontSize->value());
-	
+
 	/* Pictures tab */
 	if(pictureCheckBox->isChecked())
 		config->convertPictures();
-	config->setPicturesDir(pathPictures->url());
-	
+	config->setPicturesDir(pathPictures->url().path());
+
 	/* Language tab */
 	config->setEncoding(encodingComboBox->currentText());
 	for(unsigned int index = 0; index < langUsedList->count(); index++)
@@ -206,7 +206,7 @@
 		kDebug(30522) << "lang. : " << langUsedList->item(index)->text() << endl;
 		config->addLanguage(langUsedList->item(index)->text());
 	}
-	
+
 	/* The default language is the first language in the list */
 	if(langUsedList->item(0) != NULL)
 		config->setDefaultLanguage(langUsedList->item(0)->text());
@@ -216,7 +216,7 @@
 		config->setDefaultLanguage(langUsedList->currentText());
 	}
 
-	Document doc(_in, _fileOut);	
+	Document doc(_in, _fileOut);
 	kDebug(30522) << "---------- analyse file -------------" << endl;
 	doc.analyse();
 	kDebug(30522) << "---------- generate file -------------" << endl;
--- trunk/koffice/filters/kword/html/export/ExportDialog.cc #579646:579647
@@ -89,7 +89,7 @@
     kDebug(30503) << "Encoding: " << strCodec << endl;
 
     bool ok = false;
-    QTextCodec* codec = QTextCodec::codecForName( strCodec.utf8() );
+    QTextCodec* codec = QTextCodec::codecForName( strCodec.toUtf8() );
 
     // If QTextCodec has not found a valid encoding, so try with KCharsets.
     if ( codec )
@@ -138,9 +138,9 @@
     return DefaultCSS;//Our default
 }
 
-QString HtmlExportDialog::cssURL(void) const
+QString HtmlExportDialog::cssURL() const
 {
-  return m_dialog->KURL_ExternalCSS->url();
+    return m_dialog->KURL_ExternalCSS->url().url();
 }
 
 #include <ExportDialog.moc>
--- trunk/koffice/kpresenter/KPrEffectDia.cpp #579646:579647
@@ -177,6 +177,7 @@
     upperRow->addWidget( lSoundEffect1, 6, 0 );
 
     requester1 = new KUrlRequester( grp1 );
+    requester1->setMode( KFile::File | KFile::ExistingOnly | KFile::LocalOnly );
     requester1->setUrl( obj->getAppearSoundEffectFileName() );
     upperRow->addWidget( requester1, 6, 1 );
 
@@ -284,6 +285,7 @@
 
     requester2 = new KUrlRequester( grp2 );
     requester2->setUrl( obj->getDisappearSoundEffectFileName() );
+    requester2->setMode( KFile::File | KFile::ExistingOnly | KFile::LocalOnly );
     lowerRow->addWidget( requester2, 5, 1 );
 
     connect( requester2, SIGNAL( openFileDialog( KUrlRequester * ) ),
@@ -361,8 +363,8 @@
     eff.disappearTimer = timerOfDisappear->value();
     eff.appearSoundEffect = (requester1->url().isEmpty() ? false : \
                appearSoundEffect->isChecked());
     eff.disappearSoundEffect = (requester2->url().isEmpty() ? false : \
                disappearSoundEffect->isChecked());
-    eff.a_fileName = requester1->url();
-    eff.d_fileName = requester2->url();
+    eff.a_fileName = requester1->url().path();
+    eff.d_fileName = requester2->url().path();
 
     KPrEffectCmd *effectCmd = new KPrEffectCmd( i18n( "Assign Object Effects" ), \
objs, oldEffects, eff );  effectCmd->execute();
@@ -471,7 +473,7 @@
 void KPrEffectDia::playSound1()
 {
     delete soundPlayer1;
-    soundPlayer1 = new KPrSoundPlayer( requester1->url() );
+    soundPlayer1 = new KPrSoundPlayer( requester1->url().path() );
     soundPlayer1->play();
 
     buttonTestPlaySoundEffect1->setEnabled( false );
@@ -481,7 +483,7 @@
 void KPrEffectDia::playSound2()
 {
     delete soundPlayer2;
-    soundPlayer2 = new KPrSoundPlayer( requester2->url() );
+    soundPlayer2 = new KPrSoundPlayer( requester2->url().path() );
     soundPlayer2->play();
 
     buttonTestPlaySoundEffect2->setEnabled( false );
--- trunk/koffice/kpresenter/KPrMSPresentationSetup.cpp #579646:579647
@@ -313,7 +313,7 @@
     QLabel *lable2 = new QLabel( i18n("Path:"), this );
     lable2->setAlignment( Qt::AlignVCenter | Qt::AlignRight );
     path=new KUrlRequester( this );
-    path->setMode( KFile::Directory);
+    path->setMode( KFile::Directory | KFile::LocalOnly );
     path->lineEdit()->setText(msPres.getPath());
     lable2->setBuddy(path);
     Q3HBoxLayout *pathLayout = new Q3HBoxLayout;
@@ -494,7 +494,7 @@
 
 void KPrMSPresentationSetup::slotChoosePath(const KUrl &text)
 {
-    msPres.setPath(text);
+    msPres.setPath(text.path());
 }
 
 
--- trunk/koffice/kpresenter/KPrPage.h #579646:579647
@@ -79,8 +79,6 @@
 
     /**
      * @brief Return a DBUS interface for this page
-     /*
-    /* 
      * deactivate code using KPrPageAdaptor
     virtual KPrPageAdaptor* dbusObject();
     */
--- trunk/koffice/kpresenter/KPrSlideTransitionDia.cpp #579646:579647
@@ -147,6 +147,7 @@
     // set up sound
     m_dialog->soundCheckBox->setChecked( m_soundEffect );
     m_dialog->soundRequester->setUrl( m_soundFileName );
+    m_dialog->soundRequester->setMode( KFile::File | KFile::ExistingOnly | \
KFile::LocalOnly );  soundEffectChanged();
     m_dialog->playButton->setIconSet( SmallIconSet( "player_play" ) );
     m_dialog->stopButton->setIconSet( SmallIconSet( "player_stop" ) );
@@ -332,7 +333,7 @@
 
     EffectSpeed effectSpeed = static_cast<EffectSpeed>( \
m_dialog->speedCombo->currentIndex() );  bool soundEffect = \
                m_dialog->soundCheckBox->isChecked();
-    QString soundFileName = m_dialog->soundRequester->url();
+    QString soundFileName = m_dialog->soundRequester->url().path();
     int slideTime = m_dialog->automaticTransitionInput->value();
 
     if ( effect != m_effect ||
@@ -393,7 +394,7 @@
 {
     delete m_soundPlayer;
 
-    m_soundPlayer = new KPrSoundPlayer( m_dialog->soundRequester->url() );
+    m_soundPlayer = new KPrSoundPlayer( m_dialog->soundRequester->url().path() );
     m_soundPlayer->play();
 
     m_dialog->playButton->setEnabled( false );
--- trunk/koffice/kpresenter/KPrTransEffectDia.cpp #579646:579647
@@ -289,6 +289,7 @@
 
     lSoundEffect = new QLabel( i18n( "File name:" ), soundgrp );
     requester = new KUrlRequester( soundgrp );
+    requester->setMode(KFile::File|KFile::ExistingOnly|KFile::LocalOnly);
     requester->setUrl( soundFileName );
     connect( requester, SIGNAL( openFileDialog( KUrlRequester * ) ),
              this, SLOT( slotRequesterClicked( KUrlRequester * ) ) );
@@ -411,15 +412,13 @@
     // find the first "sound"-resource that contains files
     QStringList soundDirs = KGlobal::dirs()->resourceDirs( "sound" );
     if ( !soundDirs.isEmpty() ) {
-        KUrl soundURL;
         QDir dir;
         dir.setFilter( QDir::Files | QDir::Readable );
         QStringList::ConstIterator it = soundDirs.begin();
         while ( it != soundDirs.end() ) {
             dir = *it;
             if ( dir.isReadable() && dir.count() > 2 ) {
-                soundURL.setPath( *it );
-                requester->fileDialog()->setUrl( soundURL );
+                requester->fileDialog()->setUrl( KUrl::fromPath(*it) );
                 break;
             }
             ++it;
@@ -438,7 +437,7 @@
 void KPrTransEffectDia::playSound()
 {
     delete soundPlayer;
-    soundPlayer = new KPrSoundPlayer( requester->url() );
+    soundPlayer = new KPrSoundPlayer( requester->url().path() );
     soundPlayer->play();
 
     buttonTestPlaySoundEffect->setEnabled( false );
--- trunk/koffice/kpresenter/KPrWebPresentation.cpp #579646:579647
@@ -725,7 +725,7 @@
     layout->addWidget( email, 4, 1 );
 
     path=new KUrlRequester( canvas );
-    path->setMode( KFile::Directory);
+    path->setMode( KFile::Directory | KFile::LocalOnly );
     path->lineEdit()->setText(webPres.getPath());
     path->setWhatsThis( i18n("The value entered for the path is the directory "
                                 "where the presentation will be saved. If it does "
@@ -1129,9 +1129,9 @@
     K3Wizard::closeEvent( e );
 }
 
-void KPrWebPresentationWizard::slotChoosePath(const KUrl &text)
+void KPrWebPresentationWizard::slotChoosePath(const KUrl &url)
 {
-        webPres.setPath(text);
+    webPres.setPath(url.path());
 }
 
 void KPrWebPresentationWizard::slotChoosePath(const QString &text)


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic