30
35
m_pTar = new KTar( _filename, "application/x-gzip" );
32
37
m_bGood = init( _mode ); // open the targz file and init some vars
38
kdDebug()<<"appIdentification :"<<appIdentification<<endl;
34
39
if ( m_bGood && _mode == Write )
35
40
m_pTar->setOrigFileName( completeMagic( appIdentification ) );
45
50
m_pTar->setOrigFileName( completeMagic( appIdentification ) );
53
KoTarStore::KoTarStore( QWidget* window, const KURL& _url, const QString & _filename, Mode _mode, const QCString & appIdentification )
55
kdDebug(s_area) << "KoTarStore Constructor url= " << _url.prettyURL()
56
<< " filename = " << _filename
57
<< " mode = " << int(_mode) << endl;
62
if ( _mode == KoStore::Read )
64
m_fileMode = KoStoreBase::RemoteRead;
65
m_localFileName = _filename;
70
m_fileMode = KoStoreBase::RemoteWrite;
71
m_localFileName = "/tmp/kozip"; // ### FIXME with KTempFile
74
m_pTar = new KTar( m_localFileName, "application/x-gzip" );
76
m_bGood = init( _mode ); // open the targz file and init some vars
78
if ( m_bGood && _mode == Write )
79
m_pTar->setOrigFileName( completeMagic( appIdentification ) );
48
82
KoTarStore::~KoTarStore()
87
// Now we have still some job to do for remote files.
88
if ( m_fileMode == KoStoreBase::RemoteRead )
90
KIO::NetAccess::removeTempFile( m_localFileName );
92
else if ( m_fileMode == KoStoreBase::RemoteWrite )
94
KIO::NetAccess::upload( m_localFileName, m_url, m_window );
95
// ### FIXME: delete temp file
54
99
QCString KoTarStore::completeMagic( const QCString& appMimetype )
101
kdDebug()<<"QCString KoTarStore::completeMagic( const QCString& appMimetype )********************\n";
56
102
QCString res( "KOffice " );
57
103
res += appMimetype;
58
104
res += '\004'; // Two magic bytes to make the identification
59
105
res += '\006'; // more reliable (DF)
106
kdDebug()<<"sssssssssssssssssssssxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx\n";
107
kdDebug()<<" return :!!!!!!!!!!!!!!! :"<<res<<endl;