Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Z
zathura
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
110
Issues
110
List
Boards
Labels
Milestones
Merge Requests
4
Merge Requests
4
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
pwmt
zathura
Commits
b4afb542
Commit
b4afb542
authored
Jan 20, 2019
by
Sebastian Ramacher
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Improve warnings in case of an error
parent
cebfaf01
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
10 deletions
+9
-10
zathura/database-sqlite.c
zathura/database-sqlite.c
+9
-10
No files found.
zathura/database-sqlite.c
View file @
b4afb542
...
@@ -255,12 +255,12 @@ sqlite_db_check_layout(sqlite3* session, const int database_version, const bool
...
@@ -255,12 +255,12 @@ sqlite_db_check_layout(sqlite3* session, const int database_version, const bool
if
(
database_version
<
1
)
if
(
database_version
<
1
)
{
{
/* check existing tables for missing columns */
/* check existing tables for missing columns */
bool
res1
,
re
s2
,
ret1
,
ret2
;
bool
res1
,
re
t1
;
ret1
=
check_column
(
session
,
"fileinfo"
,
"pages_per_row"
,
&
res1
);
ret1
=
check_column
(
session
,
"fileinfo"
,
"pages_per_row"
,
&
res1
);
if
(
ret1
==
true
&&
res1
==
false
)
{
if
(
ret1
==
true
&&
res1
==
false
)
{
if
(
sqlite3_exec
(
session
,
SQL_FILEINFO_ALTER
,
NULL
,
0
,
NULL
)
!=
SQLITE_OK
)
{
if
(
sqlite3_exec
(
session
,
SQL_FILEINFO_ALTER
,
NULL
,
0
,
NULL
)
!=
SQLITE_OK
)
{
girara_warning
(
"failed to update database table layout"
);
girara_warning
(
"failed to update database table layout
: pages_per_row, position_x, position_y
"
);
all_updates_ok
=
false
;
all_updates_ok
=
false
;
}
}
}
}
...
@@ -269,7 +269,7 @@ sqlite_db_check_layout(sqlite3* session, const int database_version, const bool
...
@@ -269,7 +269,7 @@ sqlite_db_check_layout(sqlite3* session, const int database_version, const bool
if
(
ret1
==
true
&&
res1
==
false
)
{
if
(
ret1
==
true
&&
res1
==
false
)
{
if
(
sqlite3_exec
(
session
,
SQL_FILEINFO_ALTER2
,
NULL
,
0
,
NULL
)
!=
SQLITE_OK
)
{
if
(
sqlite3_exec
(
session
,
SQL_FILEINFO_ALTER2
,
NULL
,
0
,
NULL
)
!=
SQLITE_OK
)
{
girara_warning
(
"failed to update database table layout"
);
girara_warning
(
"failed to update database table layout
: first_page_column
"
);
all_updates_ok
=
false
;
all_updates_ok
=
false
;
}
}
}
}
...
@@ -278,7 +278,7 @@ sqlite_db_check_layout(sqlite3* session, const int database_version, const bool
...
@@ -278,7 +278,7 @@ sqlite_db_check_layout(sqlite3* session, const int database_version, const bool
if
(
ret1
==
true
&&
res1
==
false
)
{
if
(
ret1
==
true
&&
res1
==
false
)
{
if
(
sqlite3_exec
(
session
,
SQL_FILEINFO_ALTER3
,
NULL
,
0
,
NULL
)
!=
SQLITE_OK
)
{
if
(
sqlite3_exec
(
session
,
SQL_FILEINFO_ALTER3
,
NULL
,
0
,
NULL
)
!=
SQLITE_OK
)
{
girara_warning
(
"failed to update database table layout"
);
girara_warning
(
"failed to update database table layout
: time
"
);
all_updates_ok
=
false
;
all_updates_ok
=
false
;
}
}
}
}
...
@@ -287,7 +287,7 @@ sqlite_db_check_layout(sqlite3* session, const int database_version, const bool
...
@@ -287,7 +287,7 @@ sqlite_db_check_layout(sqlite3* session, const int database_version, const bool
if
(
ret1
==
true
&&
res1
==
false
)
{
if
(
ret1
==
true
&&
res1
==
false
)
{
if
(
sqlite3_exec
(
session
,
SQL_FILEINFO_ALTER4
,
NULL
,
0
,
NULL
)
!=
SQLITE_OK
)
{
if
(
sqlite3_exec
(
session
,
SQL_FILEINFO_ALTER4
,
NULL
,
0
,
NULL
)
!=
SQLITE_OK
)
{
girara_warning
(
"failed to update database table layout"
);
girara_warning
(
"failed to update database table layout
: zoom
"
);
all_updates_ok
=
false
;
all_updates_ok
=
false
;
}
}
}
}
...
@@ -296,17 +296,16 @@ sqlite_db_check_layout(sqlite3* session, const int database_version, const bool
...
@@ -296,17 +296,16 @@ sqlite_db_check_layout(sqlite3* session, const int database_version, const bool
if
(
ret1
==
true
&&
res1
==
false
)
{
if
(
ret1
==
true
&&
res1
==
false
)
{
if
(
sqlite3_exec
(
session
,
SQL_FILEINFO_ALTER5
,
NULL
,
0
,
NULL
)
!=
SQLITE_OK
)
{
if
(
sqlite3_exec
(
session
,
SQL_FILEINFO_ALTER5
,
NULL
,
0
,
NULL
)
!=
SQLITE_OK
)
{
girara_warning
(
"failed to update database table layout"
);
girara_warning
(
"failed to update database table layout
: pages_right_to_left
"
);
all_updates_ok
=
false
;
all_updates_ok
=
false
;
}
}
}
}
ret1
=
check_column
(
session
,
"bookmarks"
,
"hadj_ratio"
,
&
res1
);
ret1
=
check_column
(
session
,
"bookmarks"
,
"hadj_ratio"
,
&
res1
);
ret2
=
check_column
(
session
,
"bookmarks"
,
"vadj_ratio"
,
&
res2
);
if
(
ret1
==
true
&&
re
t2
==
true
&&
res1
==
false
&&
res2
==
false
)
{
if
(
ret1
==
true
&&
re
s1
==
false
)
{
if
(
sqlite3_exec
(
session
,
SQL_BOOKMARK_ALTER
,
NULL
,
0
,
NULL
)
!=
SQLITE_OK
)
{
if
(
sqlite3_exec
(
session
,
SQL_BOOKMARK_ALTER
,
NULL
,
0
,
NULL
)
!=
SQLITE_OK
)
{
girara_warning
(
"failed to update database table layout"
);
girara_warning
(
"failed to update database table layout
: hadj_ration, vadj_ratio
"
);
all_updates_ok
=
false
;
all_updates_ok
=
false
;
}
}
}
}
...
@@ -331,7 +330,7 @@ sqlite_db_check_layout(sqlite3* session, const int database_version, const bool
...
@@ -331,7 +330,7 @@ sqlite_db_check_layout(sqlite3* session, const int database_version, const bool
g_strlcat
(
transaction
,
tx_end
,
sizeof
(
transaction
));
g_strlcat
(
transaction
,
tx_end
,
sizeof
(
transaction
));
if
(
sqlite3_exec
(
session
,
transaction
,
NULL
,
0
,
NULL
)
!=
SQLITE_OK
)
{
if
(
sqlite3_exec
(
session
,
transaction
,
NULL
,
0
,
NULL
)
!=
SQLITE_OK
)
{
girara_warning
(
"failed to update database table layout"
);
girara_warning
(
"failed to update database table layout
: first_page_column
"
);
all_updates_ok
=
false
;
all_updates_ok
=
false
;
}
}
}
}
...
...
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