Replace auto_ptr

Signed-off-by: Michele Calgaro <michele.calgaro@yahoo.it>
pull/69/head
Michele Calgaro 10 months ago
parent 1329ec6abb
commit bfb6a86ee2
Signed by: MicheleC
GPG Key ID: 2A75B7CA8ADED5CF

@ -79,7 +79,11 @@ class ContactListViewStrategy;
class KopeteContactListViewPrivate class KopeteContactListViewPrivate
{ {
public: public:
std::auto_ptr<ContactListViewStrategy> viewStrategy; KopeteContactListViewPrivate() {}
KopeteContactListViewPrivate(KopeteContactListViewPrivate const &) = delete;
KopeteContactListViewPrivate& operator=(KopeteContactListViewPrivate const &) = delete;
std::unique_ptr<ContactListViewStrategy> viewStrategy;
void updateViewStrategy( TDEListView *view ); void updateViewStrategy( TDEListView *view );
}; };
@ -365,7 +369,7 @@ void KopeteContactListViewPrivate::updateViewStrategy( TDEListView *view )
if ( !viewStrategy.get() || KopetePrefs::prefs()->sortByGroup() != bSortByGroup ) if ( !viewStrategy.get() || KopetePrefs::prefs()->sortByGroup() != bSortByGroup )
{ {
// delete old strategy first... // delete old strategy first...
viewStrategy.reset( 0 ); viewStrategy.reset();
// then create and store a new one // then create and store a new one
if ( KopetePrefs::prefs()->sortByGroup() ) if ( KopetePrefs::prefs()->sortByGroup() )
viewStrategy.reset( new ArrangeByGroupsViewStrategy(view) ); viewStrategy.reset( new ArrangeByGroupsViewStrategy(view) );

@ -38,11 +38,15 @@
class KopeteGroupViewItem::Private class KopeteGroupViewItem::Private
{ {
public: public:
Private() {}
Private(Private const &) = delete;
Private& operator=(Private const &) = delete;
Kopete::UI::ListView::GroupBoxComponent *hbox; Kopete::UI::ListView::GroupBoxComponent *hbox;
Kopete::UI::ListView::ImageComponent *image; Kopete::UI::ListView::ImageComponent *image;
Kopete::UI::ListView::TextComponent *name; Kopete::UI::ListView::TextComponent *name;
Kopete::UI::ListView::TextComponent *count; Kopete::UI::ListView::TextComponent *count;
std::auto_ptr<Kopete::UI::ListView::ToolTipSource> toolTipSource; std::unique_ptr<Kopete::UI::ListView::ToolTipSource> toolTipSource;
}; };
namespace Kopete { namespace Kopete {

@ -150,13 +150,15 @@ class KopeteMetaContactLVI::Private
public: public:
Private() : metaContactIcon( 0L ), nameText( 0L ), extraText( 0L ), contactIconBox( 0L ), Private() : metaContactIcon( 0L ), nameText( 0L ), extraText( 0L ), contactIconBox( 0L ),
currentMode( -1 ), currentIconMode( -1 ), hbox(NULL) {} currentMode( -1 ), currentIconMode( -1 ), hbox(NULL) {}
Private(Private const &) = delete;
Private& operator=(Private const &) = delete;
ListView::ContactBoxComponent *hbox; ListView::ContactBoxComponent *hbox;
ListView::FaceComponent *metaContactIcon; ListView::FaceComponent *metaContactIcon;
ListView::DisplayNameComponent *nameText; ListView::DisplayNameComponent *nameText;
ListView::DisplayNameComponent *extraText; ListView::DisplayNameComponent *extraText;
ListView::BoxComponent *contactIconBox; ListView::BoxComponent *contactIconBox;
ListView::BoxComponent *spacerBox; ListView::BoxComponent *spacerBox;
std::auto_ptr<ListView::ToolTipSource> toolTipSource; std::unique_ptr<ListView::ToolTipSource> toolTipSource;
// metacontact icon size // metacontact icon size
int iconSize; int iconSize;
// protocol icon size // protocol icon size

@ -97,9 +97,11 @@ void ToolTip::maybeTip( const TQPoint &pos )
struct ListView::Private struct ListView::Private
{ {
TQTimer sortTimer; TQTimer sortTimer;
std::auto_ptr<ToolTip> toolTip; std::unique_ptr<ToolTip> toolTip;
//! C-tor //! C-tor
Private() {} Private() {}
Private(Private const &) = delete;
Private& operator=(Private const &) = delete;
}; };
ListView::ListView( TQWidget *parent, const char *name ) ListView::ListView( TQWidget *parent, const char *name )

@ -15,7 +15,7 @@
// scoped_ptr mimics a built-in pointer except that it guarantees deletion // scoped_ptr mimics a built-in pointer except that it guarantees deletion
// of the object pointed to, either on destruction of the scoped_ptr or via // of the object pointed to, either on destruction of the scoped_ptr or via
// an explicit reset(). scoped_ptr is a simple solution for simple needs; // an explicit reset(). scoped_ptr is a simple solution for simple needs;
// use shared_ptr or std::auto_ptr if your needs are more complex. // use shared_ptr or std::unique_ptr if your needs are more complex.
// scoped_ptr_malloc added in by Google. When one of // scoped_ptr_malloc added in by Google. When one of
// these goes out of scope, instead of doing a delete or delete[], it // these goes out of scope, instead of doing a delete or delete[], it

@ -50,7 +50,7 @@ struct SmartPtrRefCount {
* deletes the object. * deletes the object.
* *
* The recommended way to use SmartPtr and @ref WeakPtr is to use SmartPtr * The recommended way to use SmartPtr and @ref WeakPtr is to use SmartPtr
* for all aggregations and WeakPtr for associations. Unlike auto_ptr, * for all aggregations and WeakPtr for associations.
* SmartPtr can be used in collections. * SmartPtr can be used in collections.
* *
* SmartPtr is not thread-safe. All instances of SmartPtrs pointing * SmartPtr is not thread-safe. All instances of SmartPtrs pointing

Loading…
Cancel
Save