From ce5678b0f72b70565526cacc32296687880cd179 Mon Sep 17 00:00:00 2001 From: Ivailo Monev Date: Sun, 24 Apr 2022 12:06:58 +0300 Subject: [PATCH] generic: replace deprecated std::auto_ptr with std::unique_ptr Signed-off-by: Ivailo Monev --- gwenview/app/imagemetainfodialog.cpp | 2 +- gwenview/app/main.cpp | 4 ++-- gwenview/importer/importer.cpp | 2 +- gwenview/lib/print/printhelper.cpp | 2 +- gwenview/tests/auto/importertest.h | 2 +- okular/core/document.cpp | 8 ++++---- okular/part.cpp | 2 +- 7 files changed, 11 insertions(+), 11 deletions(-) diff --git a/gwenview/app/imagemetainfodialog.cpp b/gwenview/app/imagemetainfodialog.cpp index bbcecc7d..89bae6b8 100644 --- a/gwenview/app/imagemetainfodialog.cpp +++ b/gwenview/app/imagemetainfodialog.cpp @@ -112,7 +112,7 @@ private: struct ImageMetaInfoDialogPrivate { - std::auto_ptr mModel; + std::unique_ptr mModel; QTreeView* mTreeView; }; diff --git a/gwenview/app/main.cpp b/gwenview/app/main.cpp index ee0dfe8b..3c9ac541 100644 --- a/gwenview/app/main.cpp +++ b/gwenview/app/main.cpp @@ -103,8 +103,8 @@ private: KUrl mUrl; bool mFullScreen; bool mSlideShow; - std::auto_ptr mMultipleUrlsDir; - std::auto_ptr mMainWindow; + std::unique_ptr mMultipleUrlsDir; + std::unique_ptr mMainWindow; }; int main(int argc, char *argv[]) diff --git a/gwenview/importer/importer.cpp b/gwenview/importer/importer.cpp index befe4067..9525e662 100644 --- a/gwenview/importer/importer.cpp +++ b/gwenview/importer/importer.cpp @@ -51,7 +51,7 @@ struct ImporterPrivate { Importer* q; QWidget* mAuthWindow; - std::auto_ptr mFileNameFormater; + std::unique_ptr mFileNameFormater; KUrl mTempImportDir; /* @defgroup reset Should be reset in start() diff --git a/gwenview/lib/print/printhelper.cpp b/gwenview/lib/print/printhelper.cpp index 0afe86eb..8309f3b9 100644 --- a/gwenview/lib/print/printhelper.cpp +++ b/gwenview/lib/print/printhelper.cpp @@ -123,7 +123,7 @@ void PrintHelper::print(Document::Ptr doc) PrintOptionsPage* optionsPage = new PrintOptionsPage(doc->size()); optionsPage->loadConfig(); - std::auto_ptr dialog( + std::unique_ptr dialog( KdePrint::createPrintDialog(&printer, QList() << optionsPage, d->mParent) diff --git a/gwenview/tests/auto/importertest.h b/gwenview/tests/auto/importertest.h index a12529f0..d6084dbe 100644 --- a/gwenview/tests/auto/importertest.h +++ b/gwenview/tests/auto/importertest.h @@ -46,7 +46,7 @@ private Q_SLOTS: void testRenamedCount(); private: - std::auto_ptr mTempDir; + std::unique_ptr mTempDir; KUrl::List mDocumentList; }; diff --git a/okular/core/document.cpp b/okular/core/document.cpp index 3d449a5b..2bfb9645 100644 --- a/okular/core/document.cpp +++ b/okular/core/document.cpp @@ -4053,7 +4053,7 @@ Document::OpenResult Document::openDocumentArchive( const QString & docFile, con if ( !mainEntry || !mainEntry->isFile() ) 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; if ( !doc.setContent( mainEntryDevice.get() ) ) return OpenError; @@ -4087,7 +4087,7 @@ Document::OpenResult Document::openDocumentArchive( const QString & docFile, con if ( !docEntry || !docEntry->isFile() ) return OpenError; - std::auto_ptr< ArchiveData > archiveData( new ArchiveData() ); + std::unique_ptr< ArchiveData > archiveData( new ArchiveData() ); const int dotPos = documentFileName.indexOf( '.' ); if ( dotPos != -1 ) archiveData->document.setSuffix( documentFileName.mid( dotPos ) ); @@ -4096,7 +4096,7 @@ Document::OpenResult Document::openDocumentArchive( const QString & docFile, con 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 ); archiveData->document.close(); } @@ -4104,7 +4104,7 @@ Document::OpenResult Document::openDocumentArchive( const QString & docFile, con const KArchiveEntry * metadataEntry = mainDir->entry( metadataFileName ); 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" ); if ( archiveData->metadataFile.open() ) { diff --git a/okular/part.cpp b/okular/part.cpp index 312e1fbf..1e11803c 100644 --- a/okular/part.cpp +++ b/okular/part.cpp @@ -194,7 +194,7 @@ static QString compressedMimeFor( const QString& mime_to_check ) const QString app_xz( QString::fromLatin1( "application/x-xz" ) ); if ( compressedMimeMap.isEmpty() ) { - std::auto_ptr< KFilterBase > f; + std::unique_ptr< KFilterBase > f; compressedMimeMap[ QString::fromLatin1( "image/x-gzeps" ) ] = app_gzip; // check we can read bzip2-compressed files f.reset( KFilterBase::findFilterByMimeType( app_bzip ) );