Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
xfce4-screenshooter
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Analyze
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Apps
xfce4-screenshooter
Commits
9f90325e
Commit
9f90325e
authored
16 years ago
by
Jerome Guelfucci
Browse files
Options
Downloads
Patches
Plain Diff
Clean generate_filename_for_uri using g_access
(Old svn revision: 4999)
parent
ae46c0b7
No related branches found
No related tags found
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
ChangeLog
+4
-0
4 additions, 0 deletions
ChangeLog
po/POTFILES.in
+0
-1
0 additions, 1 deletion
po/POTFILES.in
src/screenshooter-utils.c
+24
-19
24 additions, 19 deletions
src/screenshooter-utils.c
with
28 additions
and
20 deletions
ChangeLog
+
4
−
0
View file @
9f90325e
2008-06-27 jeromeg
* src/screenshooter-utils.c: clean generate_filename_for_uri using g_access.
2008-06-20 09:19 jeromeg
* NEWS: updated.
...
...
This diff is collapsed.
Click to expand it.
po/POTFILES.in
+
0
−
1
View file @
9f90325e
src/screenshooter-plugin.c
src/main.c
src/screenshooter.desktop.in.in
This diff is collapsed.
Click to expand it.
src/screenshooter-utils.c
+
24
−
19
View file @
9f90325e
...
...
@@ -27,8 +27,6 @@
#include
<screenshooter-utils.h>
#define MODE 0644
/* Prototypes */
static
Window
get_window_property
(
Window
xwindow
,
Atom
atom
);
...
...
@@ -151,22 +149,29 @@ GdkPixbuf *take_screenshot (gint fullscreen, gint delay)
gchar
*
generate_filename_for_uri
(
char
*
uri
)
{
int
test
;
gchar
*
file_name
;
unsigned
int
i
=
0
;
if
(
uri
==
NULL
)
return
NULL
;
file_name
=
g_strdup
(
"Screenshot.png"
);
if
((
test
=
open
(
g_build_filename
(
uri
,
file_name
,
NULL
),
O_RDWR
,
MODE
))
==-
1
)
{
return
file_name
;
}
do
{
i
++
;
g_free
(
file_name
);
file_name
=
g_strdup_printf
(
"Screenshot-%d.png"
,
i
);
}
while
((
test
=
open
(
g_build_filename
(
uri
,
file_name
,
NULL
),
O_RDWR
,
MODE
))
!=-
1
);
int
test
;
gchar
*
file_name
;
unsigned
int
i
=
0
;
if
(
uri
==
NULL
)
{
return
NULL
;
}
file_name
=
g_strdup
(
"Screenshot.png"
);
if
(
(
test
=
g_access
(
g_build_filename
(
uri
,
file_name
,
NULL
),
F_OK
)
)
!=
0
)
{
return
file_name
;
}
do
{
i
++
;
g_free
(
file_name
);
file_name
=
g_strdup_printf
(
"Screenshot-%d.png"
,
i
);
}
while
(
(
test
=
g_access
(
g_build_filename
(
uri
,
file_name
,
NULL
),
F_OK
)
)
==
-
1
);
return
file_name
;
}
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment