mirror of
https://bitbucket.org/smil3y/kde-extraapps.git
synced 2025-02-24 02:42:52 +00:00
generic: replace deprecated std::auto_ptr<T> with std::unique_ptr<T>
Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
This commit is contained in:
parent
173adc2e7a
commit
ce5678b0f7
7 changed files with 11 additions and 11 deletions
|
@ -112,7 +112,7 @@ private:
|
||||||
|
|
||||||
struct ImageMetaInfoDialogPrivate
|
struct ImageMetaInfoDialogPrivate
|
||||||
{
|
{
|
||||||
std::auto_ptr<PreferredImageMetaInfoModel> mModel;
|
std::unique_ptr<PreferredImageMetaInfoModel> mModel;
|
||||||
QTreeView* mTreeView;
|
QTreeView* mTreeView;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -103,8 +103,8 @@ private:
|
||||||
KUrl mUrl;
|
KUrl mUrl;
|
||||||
bool mFullScreen;
|
bool mFullScreen;
|
||||||
bool mSlideShow;
|
bool mSlideShow;
|
||||||
std::auto_ptr<KTempDir> mMultipleUrlsDir;
|
std::unique_ptr<KTempDir> mMultipleUrlsDir;
|
||||||
std::auto_ptr<Gwenview::MainWindow> mMainWindow;
|
std::unique_ptr<Gwenview::MainWindow> mMainWindow;
|
||||||
};
|
};
|
||||||
|
|
||||||
int main(int argc, char *argv[])
|
int main(int argc, char *argv[])
|
||||||
|
|
|
@ -51,7 +51,7 @@ struct ImporterPrivate
|
||||||
{
|
{
|
||||||
Importer* q;
|
Importer* q;
|
||||||
QWidget* mAuthWindow;
|
QWidget* mAuthWindow;
|
||||||
std::auto_ptr<FileNameFormater> mFileNameFormater;
|
std::unique_ptr<FileNameFormater> mFileNameFormater;
|
||||||
KUrl mTempImportDir;
|
KUrl mTempImportDir;
|
||||||
|
|
||||||
/* @defgroup reset Should be reset in start()
|
/* @defgroup reset Should be reset in start()
|
||||||
|
|
|
@ -123,7 +123,7 @@ void PrintHelper::print(Document::Ptr doc)
|
||||||
PrintOptionsPage* optionsPage = new PrintOptionsPage(doc->size());
|
PrintOptionsPage* optionsPage = new PrintOptionsPage(doc->size());
|
||||||
optionsPage->loadConfig();
|
optionsPage->loadConfig();
|
||||||
|
|
||||||
std::auto_ptr<QPrintDialog> dialog(
|
std::unique_ptr<QPrintDialog> dialog(
|
||||||
KdePrint::createPrintDialog(&printer,
|
KdePrint::createPrintDialog(&printer,
|
||||||
QList<QWidget*>() << optionsPage,
|
QList<QWidget*>() << optionsPage,
|
||||||
d->mParent)
|
d->mParent)
|
||||||
|
|
|
@ -46,7 +46,7 @@ private Q_SLOTS:
|
||||||
void testRenamedCount();
|
void testRenamedCount();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
std::auto_ptr<KTempDir> mTempDir;
|
std::unique_ptr<KTempDir> mTempDir;
|
||||||
KUrl::List mDocumentList;
|
KUrl::List mDocumentList;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -4053,7 +4053,7 @@ Document::OpenResult Document::openDocumentArchive( const QString & docFile, con
|
||||||
if ( !mainEntry || !mainEntry->isFile() )
|
if ( !mainEntry || !mainEntry->isFile() )
|
||||||
return OpenError;
|
return OpenError;
|
||||||
|
|
||||||
std::auto_ptr< QIODevice > mainEntryDevice( static_cast< const KZipFileEntry * >( mainEntry )->createDevice() );
|
std::unique_ptr< QIODevice > mainEntryDevice( static_cast< const KZipFileEntry * >( mainEntry )->createDevice() );
|
||||||
QDomDocument doc;
|
QDomDocument doc;
|
||||||
if ( !doc.setContent( mainEntryDevice.get() ) )
|
if ( !doc.setContent( mainEntryDevice.get() ) )
|
||||||
return OpenError;
|
return OpenError;
|
||||||
|
@ -4087,7 +4087,7 @@ Document::OpenResult Document::openDocumentArchive( const QString & docFile, con
|
||||||
if ( !docEntry || !docEntry->isFile() )
|
if ( !docEntry || !docEntry->isFile() )
|
||||||
return OpenError;
|
return OpenError;
|
||||||
|
|
||||||
std::auto_ptr< ArchiveData > archiveData( new ArchiveData() );
|
std::unique_ptr< ArchiveData > archiveData( new ArchiveData() );
|
||||||
const int dotPos = documentFileName.indexOf( '.' );
|
const int dotPos = documentFileName.indexOf( '.' );
|
||||||
if ( dotPos != -1 )
|
if ( dotPos != -1 )
|
||||||
archiveData->document.setSuffix( documentFileName.mid( dotPos ) );
|
archiveData->document.setSuffix( documentFileName.mid( dotPos ) );
|
||||||
|
@ -4096,7 +4096,7 @@ Document::OpenResult Document::openDocumentArchive( const QString & docFile, con
|
||||||
|
|
||||||
QString tempFileName = archiveData->document.fileName();
|
QString tempFileName = archiveData->document.fileName();
|
||||||
{
|
{
|
||||||
std::auto_ptr< QIODevice > docEntryDevice( static_cast< const KZipFileEntry * >( docEntry )->createDevice() );
|
std::unique_ptr< QIODevice > docEntryDevice( static_cast< const KZipFileEntry * >( docEntry )->createDevice() );
|
||||||
copyQIODevice( docEntryDevice.get(), &archiveData->document );
|
copyQIODevice( docEntryDevice.get(), &archiveData->document );
|
||||||
archiveData->document.close();
|
archiveData->document.close();
|
||||||
}
|
}
|
||||||
|
@ -4104,7 +4104,7 @@ Document::OpenResult Document::openDocumentArchive( const QString & docFile, con
|
||||||
const KArchiveEntry * metadataEntry = mainDir->entry( metadataFileName );
|
const KArchiveEntry * metadataEntry = mainDir->entry( metadataFileName );
|
||||||
if ( metadataEntry && metadataEntry->isFile() )
|
if ( metadataEntry && metadataEntry->isFile() )
|
||||||
{
|
{
|
||||||
std::auto_ptr< QIODevice > metadataEntryDevice( static_cast< const KZipFileEntry * >( metadataEntry )->createDevice() );
|
std::unique_ptr< QIODevice > metadataEntryDevice( static_cast< const KZipFileEntry * >( metadataEntry )->createDevice() );
|
||||||
archiveData->metadataFile.setSuffix( ".xml" );
|
archiveData->metadataFile.setSuffix( ".xml" );
|
||||||
if ( archiveData->metadataFile.open() )
|
if ( archiveData->metadataFile.open() )
|
||||||
{
|
{
|
||||||
|
|
|
@ -194,7 +194,7 @@ static QString compressedMimeFor( const QString& mime_to_check )
|
||||||
const QString app_xz( QString::fromLatin1( "application/x-xz" ) );
|
const QString app_xz( QString::fromLatin1( "application/x-xz" ) );
|
||||||
if ( compressedMimeMap.isEmpty() )
|
if ( compressedMimeMap.isEmpty() )
|
||||||
{
|
{
|
||||||
std::auto_ptr< KFilterBase > f;
|
std::unique_ptr< KFilterBase > f;
|
||||||
compressedMimeMap[ QString::fromLatin1( "image/x-gzeps" ) ] = app_gzip;
|
compressedMimeMap[ QString::fromLatin1( "image/x-gzeps" ) ] = app_gzip;
|
||||||
// check we can read bzip2-compressed files
|
// check we can read bzip2-compressed files
|
||||||
f.reset( KFilterBase::findFilterByMimeType( app_bzip ) );
|
f.reset( KFilterBase::findFilterByMimeType( app_bzip ) );
|
||||||
|
|
Loading…
Add table
Reference in a new issue