Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
A
apk
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Administrator
apk
Commits
8b73d93d
Commit
8b73d93d
authored
Aug 24, 2014
by
DrKLO
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixed database update to new version
parent
21273f82
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
2 additions
and
31 deletions
+2
-31
build.gradle
TMessagesProj/build.gradle
+1
-1
SQLiteDatabase.java
...roj/src/main/java/org/telegram/SQLite/SQLiteDatabase.java
+1
-30
No files found.
TMessagesProj/build.gradle
View file @
8b73d93d
...
@@ -80,7 +80,7 @@ android {
...
@@ -80,7 +80,7 @@ android {
defaultConfig
{
defaultConfig
{
minSdkVersion
8
minSdkVersion
8
targetSdkVersion
19
targetSdkVersion
19
versionCode
3
09
versionCode
3
10
versionName
"1.8.0"
versionName
"1.8.0"
}
}
}
}
TMessagesProj/src/main/java/org/telegram/SQLite/SQLiteDatabase.java
View file @
8b73d93d
...
@@ -11,13 +11,9 @@ package org.telegram.SQLite;
...
@@ -11,13 +11,9 @@ package org.telegram.SQLite;
import
org.telegram.messenger.FileLog
;
import
org.telegram.messenger.FileLog
;
import
org.telegram.ui.ApplicationLoader
;
import
org.telegram.ui.ApplicationLoader
;
import
java.util.HashMap
;
import
java.util.Map
;
public
class
SQLiteDatabase
{
public
class
SQLiteDatabase
{
private
final
int
sqliteHandle
;
private
final
int
sqliteHandle
;
private
final
Map
<
String
,
SQLitePreparedStatement
>
preparedMap
=
new
HashMap
<
String
,
SQLitePreparedStatement
>();
private
boolean
isOpen
=
false
;
private
boolean
isOpen
=
false
;
private
boolean
inTransaction
=
false
;
private
boolean
inTransaction
=
false
;
...
@@ -36,23 +32,13 @@ public class SQLiteDatabase {
...
@@ -36,23 +32,13 @@ public class SQLiteDatabase {
return
executeInt
(
s
,
tableName
)
!=
null
;
return
executeInt
(
s
,
tableName
)
!=
null
;
}
}
public
void
execute
(
String
sql
,
Object
...
args
)
throws
SQLiteException
{
checkOpened
();
SQLiteCursor
cursor
=
query
(
sql
,
args
);
try
{
cursor
.
next
();
}
finally
{
cursor
.
dispose
();
}
}
public
SQLitePreparedStatement
executeFast
(
String
sql
)
throws
SQLiteException
{
public
SQLitePreparedStatement
executeFast
(
String
sql
)
throws
SQLiteException
{
return
new
SQLitePreparedStatement
(
this
,
sql
,
true
);
return
new
SQLitePreparedStatement
(
this
,
sql
,
true
);
}
}
public
Integer
executeInt
(
String
sql
,
Object
...
args
)
throws
SQLiteException
{
public
Integer
executeInt
(
String
sql
,
Object
...
args
)
throws
SQLiteException
{
checkOpened
();
checkOpened
();
SQLiteCursor
cursor
=
query
(
sql
,
args
);
SQLiteCursor
cursor
=
query
Finalized
(
sql
,
args
);
try
{
try
{
if
(!
cursor
.
next
())
{
if
(!
cursor
.
next
())
{
return
null
;
return
null
;
...
@@ -63,18 +49,6 @@ public class SQLiteDatabase {
...
@@ -63,18 +49,6 @@ public class SQLiteDatabase {
}
}
}
}
public
SQLiteCursor
query
(
String
sql
,
Object
...
args
)
throws
SQLiteException
{
checkOpened
();
SQLitePreparedStatement
stmt
=
preparedMap
.
get
(
sql
);
if
(
stmt
==
null
)
{
stmt
=
new
SQLitePreparedStatement
(
this
,
sql
,
false
);
preparedMap
.
put
(
sql
,
stmt
);
}
return
stmt
.
query
(
args
);
}
public
SQLiteCursor
queryFinalized
(
String
sql
,
Object
...
args
)
throws
SQLiteException
{
public
SQLiteCursor
queryFinalized
(
String
sql
,
Object
...
args
)
throws
SQLiteException
{
checkOpened
();
checkOpened
();
return
new
SQLitePreparedStatement
(
this
,
sql
,
true
).
query
(
args
);
return
new
SQLitePreparedStatement
(
this
,
sql
,
true
).
query
(
args
);
...
@@ -83,9 +57,6 @@ public class SQLiteDatabase {
...
@@ -83,9 +57,6 @@ public class SQLiteDatabase {
public
void
close
()
{
public
void
close
()
{
if
(
isOpen
)
{
if
(
isOpen
)
{
try
{
try
{
for
(
SQLitePreparedStatement
stmt
:
preparedMap
.
values
())
{
stmt
.
finalizeQuery
();
}
commitTransaction
();
commitTransaction
();
closedb
(
sqliteHandle
);
closedb
(
sqliteHandle
);
}
catch
(
SQLiteException
e
)
{
}
catch
(
SQLiteException
e
)
{
...
...
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