Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
R
regexxer
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
1
Issues
1
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
Packages & Registries
Packages & Registries
Container Registry
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
GNOME
regexxer
Commits
84c9b5f1
Commit
84c9b5f1
authored
Feb 29, 2016
by
Murray Cumming
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Replace all (deprecated) auto_ptr with unique_ptr.
parent
f1063aa1
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
16 additions
and
23 deletions
+16
-23
src/main.cc
src/main.cc
+4
-4
src/mainwindow.cc
src/mainwindow.cc
+8
-15
src/mainwindow.h
src/mainwindow.h
+3
-3
src/prefdialog.h
src/prefdialog.h
+1
-1
No files found.
src/main.cc
View file @
84c9b5f1
...
...
@@ -90,7 +90,7 @@ private:
RegexxerOptions
();
public:
static
std
::
auto
_ptr
<
RegexxerOptions
>
create
();
static
std
::
unique
_ptr
<
RegexxerOptions
>
create
();
~
RegexxerOptions
();
Glib
::
OptionContext
&
context
()
{
return
context_
;
}
...
...
@@ -125,9 +125,9 @@ RegexxerOptions::~RegexxerOptions()
{}
// static
std
::
auto
_ptr
<
RegexxerOptions
>
RegexxerOptions
::
create
()
std
::
unique
_ptr
<
RegexxerOptions
>
RegexxerOptions
::
create
()
{
std
::
auto
_ptr
<
RegexxerOptions
>
options
(
new
RegexxerOptions
());
std
::
unique
_ptr
<
RegexxerOptions
>
options
(
new
RegexxerOptions
());
Glib
::
OptionGroup
&
group
=
options
->
group_
;
Regexxer
::
InitState
&
init
=
options
->
init_state_
;
...
...
@@ -201,7 +201,7 @@ int main(int argc, char** argv)
{
Util
::
initialize_gettext
(
PACKAGE_TARNAME
,
REGEXXER_LOCALEDIR
);
std
::
auto
_ptr
<
RegexxerOptions
>
options
=
RegexxerOptions
::
create
();
std
::
unique
_ptr
<
RegexxerOptions
>
options
=
RegexxerOptions
::
create
();
options
->
context
().
parse
(
argc
,
argv
);
Glib
::
RefPtr
<
Gtk
::
Application
>
app
=
Gtk
::
Application
::
create
(
argc
,
argv
,
Regexxer
::
conf_schema
);
...
...
src/mainwindow.cc
View file @
84c9b5f1
...
...
@@ -572,13 +572,8 @@ void MainWindow::on_hide()
// necessary since they'd be deleted in the destructor anyway. But if we
// have to do a lot of cleanup the dialogs would stay open for that time,
// which doesn't look neat.
{
// Play safe and transfer ownership, and let the dtor do the delete.
const
std
::
auto_ptr
<
Gtk
::
Dialog
>
temp
(
about_dialog_
);
}
{
const
std
::
auto_ptr
<
PrefDialog
>
temp
(
pref_dialog_
);
}
about_dialog_
.
reset
();
pref_dialog_
.
reset
();
}
void
MainWindow
::
on_style_updated
()
...
...
@@ -1173,7 +1168,7 @@ void MainWindow::on_about()
}
else
{
std
::
auto
_ptr
<
Gtk
::
AboutDialog
>
dialog
(
new
Gtk
::
AboutDialog
());
std
::
unique
_ptr
<
Gtk
::
AboutDialog
>
dialog
(
new
Gtk
::
AboutDialog
());
std
::
vector
<
Glib
::
ustring
>
authors
;
for
(
int
i
=
0
;
program_authors
[
i
];
i
++
)
authors
.
push_back
(
program_authors
[
i
]);
...
...
@@ -1194,14 +1189,13 @@ void MainWindow::on_about()
dialog
->
show
();
dialog
->
signal_response
().
connect
(
sigc
::
mem_fun
(
*
this
,
&
MainWindow
::
on_about_dialog_response
));
about_dialog_
=
dialog
;
about_dialog_
=
std
::
move
(
dialog
)
;
}
}
void
MainWindow
::
on_about_dialog_response
(
int
)
{
// Play safe and transfer ownership, and let the dtor do the delete.
const
std
::
auto_ptr
<
Gtk
::
Dialog
>
temp
(
about_dialog_
);
about_dialog_
.
reset
();
}
void
MainWindow
::
on_preferences
()
...
...
@@ -1212,20 +1206,19 @@ void MainWindow::on_preferences()
}
else
{
std
::
auto
_ptr
<
PrefDialog
>
dialog
(
new
PrefDialog
(
*
window_
));
std
::
unique
_ptr
<
PrefDialog
>
dialog
(
new
PrefDialog
(
*
window_
));
dialog
->
get_dialog
()
->
signal_hide
()
.
connect
(
sigc
::
mem_fun
(
*
this
,
&
MainWindow
::
on_pref_dialog_hide
));
dialog
->
get_dialog
()
->
show
();
pref_dialog_
=
dialog
;
pref_dialog_
=
std
::
move
(
dialog
)
;
}
}
void
MainWindow
::
on_pref_dialog_hide
()
{
// Play safe and transfer ownership, and let the dtor do the delete.
const
std
::
auto_ptr
<
PrefDialog
>
temp
(
pref_dialog_
);
pref_dialog_
.
reset
();
}
void
MainWindow
::
on_conf_value_changed
(
const
Glib
::
ustring
&
key
)
...
...
src/mainwindow.h
View file @
84c9b5f1
...
...
@@ -102,7 +102,7 @@ private:
class
BusyAction
;
Glib
::
RefPtr
<
Gtk
::
Application
>
application_
;
std
::
auto
_ptr
<
Gtk
::
ApplicationWindow
>
window_
;
std
::
unique
_ptr
<
Gtk
::
ApplicationWindow
>
window_
;
Controller
controller_
;
Gtk
::
Box
*
vbox_main_
;
...
...
@@ -147,8 +147,8 @@ private:
std
::
list
<
sigc
::
connection
>
buffer_connections_
;
std
::
auto
_ptr
<
Gtk
::
Dialog
>
about_dialog_
;
std
::
auto
_ptr
<
PrefDialog
>
pref_dialog_
;
std
::
unique
_ptr
<
Gtk
::
Dialog
>
about_dialog_
;
std
::
unique
_ptr
<
PrefDialog
>
pref_dialog_
;
Glib
::
RefPtr
<
Gio
::
SimpleActionGroup
>
match_action_group_
;
Glib
::
RefPtr
<
Gio
::
SimpleActionGroup
>
edit_action_group_
;
...
...
src/prefdialog.h
View file @
84c9b5f1
...
...
@@ -50,7 +50,7 @@ public:
Gtk
::
Dialog
*
get_dialog
()
{
return
dialog_
.
get
();
}
private:
std
::
auto
_ptr
<
Gtk
::
Dialog
>
dialog_
;
std
::
unique
_ptr
<
Gtk
::
Dialog
>
dialog_
;
Gtk
::
FontButton
*
button_textview_font_
;
Gtk
::
ColorButton
*
button_match_color_
;
Gtk
::
ColorButton
*
button_current_color_
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment