summaryrefslogtreecommitdiffstats
path: root/tdeio/tdeio/netaccess.cpp
diff options
context:
space:
mode:
authorTimothy Pearson <kb9vqf@pearsoncomputing.net>2013-12-14 16:47:32 -0600
committerTimothy Pearson <kb9vqf@pearsoncomputing.net>2013-12-14 16:47:32 -0600
commit23006eeac7dfda592ef3414b8e8856d550f548a0 (patch)
tree3918c224126abdcd5d56dfe320dd96d17afcac64 /tdeio/tdeio/netaccess.cpp
parentc70244211886070b82f2ca9e9b1fa2de2cd7c4c0 (diff)
downloadtdelibs-23006eeac7dfda592ef3414b8e8856d550f548a0.tar.gz
tdelibs-23006eeac7dfda592ef3414b8e8856d550f548a0.zip
Fix incorrect labelling of local media:/ tdeioslave files in the TDEFileItem class
This relates to Bug 1708
Diffstat (limited to 'tdeio/tdeio/netaccess.cpp')
-rw-r--r--tdeio/tdeio/netaccess.cpp38
1 files changed, 32 insertions, 6 deletions
diff --git a/tdeio/tdeio/netaccess.cpp b/tdeio/tdeio/netaccess.cpp
index cbab6684e..2867c3cf7 100644
--- a/tdeio/tdeio/netaccess.cpp
+++ b/tdeio/tdeio/netaccess.cpp
@@ -190,6 +190,12 @@ bool NetAccess::exists( const KURL & url, bool source, TQWidget* window )
return kioNet.statInternal( url, 0 /*no details*/, source, window );
}
+KURL NetAccess::localURL(const KURL& url, TQWidget* window)
+{
+ NetAccess kioNet;
+ return kioNet.localURLInternal( url, window );
+}
+
bool NetAccess::stat( const KURL & url, TDEIO::UDSEntry & entry )
{
return NetAccess::stat( url, entry, 0 );
@@ -347,6 +353,17 @@ bool NetAccess::statInternal( const KURL & url, int details, bool source,
return bJobOK;
}
+KURL NetAccess::localURLInternal( const KURL & url, TQWidget* window )
+{
+ m_localURL = url;
+ TDEIO::LocalURLJob* job = TDEIO::localURL(url);
+ job->setWindow (window);
+ connect(job, TQT_SIGNAL( localURL(TDEIO::Job*, const KURL&, bool) ),
+ this, TQT_SLOT( slotLocalURL(TDEIO::Job*, const KURL&, bool) ));
+ enter_loop();
+ return m_localURL;
+}
+
bool NetAccess::delInternal( const KURL & url, TQWidget* window )
{
bJobOK = true; // success unless further error occurs
@@ -389,6 +406,12 @@ void NetAccess::slotMimetype( TDEIO::Job *, const TQString & type )
m_mimetype = type;
}
+void NetAccess::slotLocalURL(TDEIO::Job*, const KURL & url, bool)
+{
+ m_localURL = url;
+ tqApp->exit_loop();
+}
+
TQString NetAccess::fish_executeInternal(const KURL & url, const TQString command, TQWidget* window)
{
TQString target, remoteTempFileName, resultData;
@@ -503,25 +526,28 @@ void NetAccess::slotResult( TDEIO::Job * job )
{
lastErrorCode = job->error();
bJobOK = !job->error();
- if ( !bJobOK )
- {
- if ( !lastErrorMsg )
+ if ( !bJobOK ) {
+ if ( !lastErrorMsg ) {
lastErrorMsg = new TQString;
+ }
*lastErrorMsg = job->errorString();
}
- if ( job->isA("TDEIO::StatJob") )
+ if ( job->isA("TDEIO::StatJob") ) {
m_entry = static_cast<TDEIO::StatJob *>(job)->statResult();
+ }
- if ( m_metaData )
+ if ( m_metaData ) {
*m_metaData = job->metaData();
+ }
tqApp->exit_loop();
}
void NetAccess::slotData( TDEIO::Job*, const TQByteArray& data )
{
- if ( data.isEmpty() )
+ if ( data.isEmpty() ) {
return;
+ }
unsigned offset = m_data.size();
m_data.resize( offset + data.size() );