Move to another unique ptr.
This commit is contained in:
@ -31,6 +31,7 @@
|
||||
#include <sys/wait.h>
|
||||
|
||||
#include <vector>
|
||||
#include <memory>
|
||||
|
||||
#include <FL/Fl.H>
|
||||
#include <FL/fl_ask.H>
|
||||
@ -116,7 +117,7 @@ class DLItem {
|
||||
int WgetStatus;
|
||||
|
||||
int gw, gh;
|
||||
Fl_Group *group;
|
||||
std::unique_ptr< Fl_Group > group;
|
||||
ProgressBar *prBar;
|
||||
Fl_Button *prButton;
|
||||
Fl_Widget *prTitle, *prGot, *prSize, *prRate, *pr_Rate, *prETA, *prETAt;
|
||||
@ -135,7 +136,7 @@ public:
|
||||
void pid(pid_t p) { mPid = p; }
|
||||
void child_finished(int status);
|
||||
void status_msg(const char *msg) { prBar->message((char*)msg); }
|
||||
Fl_Widget *get_widget() { return group; }
|
||||
Fl_Widget *get_widget() { return group.get(); }
|
||||
int widget_done() { return WidgetDone; }
|
||||
void widget_done(int val) { WidgetDone = val; }
|
||||
int updates_done() { return UpdatesDone; }
|
||||
@ -346,7 +347,7 @@ DLItem::DLItem(const char *full_filename, const char *url, const char *user_agen
|
||||
WgetStatus = -1;
|
||||
|
||||
gw = 400, gh = 70;
|
||||
group = new Fl_Group(0,0,gw,gh);
|
||||
group = std::make_unique< Fl_Group >(0,0,gw,gh);
|
||||
group->begin();
|
||||
prTitle = new Fl_Box(24, 7, 290, 23);
|
||||
prTitle->box(FL_RSHADOW_BOX);
|
||||
@ -436,8 +437,6 @@ DLItem::~DLItem()
|
||||
free(log_text);
|
||||
dFree(esc_url);
|
||||
dFree(cookies_path);
|
||||
|
||||
delete(group);
|
||||
}
|
||||
|
||||
/*
|
||||
|
Reference in New Issue
Block a user