Skip to content

Commit

Permalink
remove checkForExistingBlog
Browse files Browse the repository at this point in the history
  • Loading branch information
maxme committed Dec 11, 2013
1 parent fc37f78 commit 38466ec
Showing 1 changed file with 5 additions and 21 deletions.
26 changes: 5 additions & 21 deletions src/org/wordpress/android/WordPressDB.java
Original file line number Diff line number Diff line change
Expand Up @@ -406,27 +406,12 @@ public int setAllDotComAccountsVisibility(boolean visible) {
return db.update(SETTINGS_TABLE, values, "dotcomFlag=1", null);
}

public boolean checkForExistingBlog(String blogName, String blogURL, String username,

This comment has been minimized.

Copy link
@nbradbury

nbradbury Dec 11, 2013

Contributor

I celebrate the deletion of this routine :)

This comment has been minimized.

Copy link
@roundhill

roundhill Dec 11, 2013

Contributor

+1! ;)

String password) {
if (blogName == null || blogURL == null || username == null || password == null)
return false;

Cursor c = db.query(SETTINGS_TABLE, new String[]{"id", "blogName", "url"},
"blogName=? AND url=? AND username=?", new String[]{blogName, blogURL, username},
null, null, null, null);
int numRows = c.getCount();
if (numRows > 0) {
// This account is already saved
c.moveToFirst();
long blogID = c.getLong(0);
ContentValues values = new ContentValues();
values.put("password", encryptPassword(password));
db.update(SETTINGS_TABLE, values, "id=" + blogID, null);
return true;
}

public boolean isBlogInDatabase(String xmlRpcUrl, int blogId) {
Cursor c = db.query(SETTINGS_TABLE, new String[]{"id"}, "blogId=? AND url=?",
new String[]{String.valueOf(blogId), xmlRpcUrl}, null, null, null, null);
boolean result = c.getCount() > 0;
c.close();
return false;
return result;
}

public boolean saveBlog(Blog blog) {
Expand Down Expand Up @@ -1389,7 +1374,6 @@ public boolean addQuickPressShortcut(int accountId, String name) {
}

public List<Map<String, Object>> getQuickPressShortcuts(int accountId) {

Cursor c = db.query(QUICKPRESS_SHORTCUTS_TABLE, new String[] { "id",
"accountId", "name" }, "accountId = " + accountId, null, null,
null, null);
Expand Down

0 comments on commit 38466ec

Please sign in to comment.