Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TIMOB-9550: BlackBerry: Implement App elements needed for KitchenSink #112

Merged
merged 3 commits into from Jul 24, 2012

Conversation

dlifshitz-maca
Copy link

Reviewer: Alex

[Issues Fixed]
TIMOB-9550: BlackBerry: Implement App elements needed for KitchenSink

[Added]
NativeSimpleDBInterface.cpp
NativeSimpleDBInterface.h
TiAppObject.cpp
TiAppObject.h
TiAppPropertiesObject.cpp
TiAppPropertiesObject.h

[Changes]
NativeMessageStrings.h

  • added Create_table_failed

TiMessageStrings.h

  • fixed order
  • added Invalid_argument_expected_, Type_does_not_match

TiTitaniumObject.cpp

  • added TiAppObject

[Tests]
Test 1: Run the test app from Jira

  1. Create a project and replace app.js with the one from the Jira
  2. Build, package, and run the app
  3. Verify the text matches the expected output and the persistent bool is false
  4. Close and rerun the app and verify the persistent bool is true

[Issues Fixed]
TIMOB-9550: BlackBerry: Implement App elements needed for KitchenSink

[Added]
NativeSimpleDBInterface.cpp
NativeSimpleDBInterface.h
TiAppObject.cpp
TiAppObject.h
TiAppPropertiesObject.cpp
TiAppPropertiesObject.h

[Changes]
NativeMessageStrings.h
- added Create_table_failed

TiMessageStrings.h
- fixed order
- added Invalid_argument_expected_, Type_does_not_match

TiTitaniumObject.cpp
- added TiAppObject

[Tests]
Test 1: Run the test app from Jira
1) Create a project and replace app.js with the one from the Jira
2) Build, package, and run the app
3) Verify the text matches the expected output and the persistent bool is false
4) Close and rerun the app and verify the persistent bool is true
db_.open();
Q_ASSERT(db_.isOpen());
QSqlQuery query(db_);
query.exec("CREATE TABLE IF NOT EXISTS " + table_ + " (simpleKey CHAR(10) PRIMARY KEY, simpleValue TEXT)");

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why don't use VARCHAR here to not make key fixed length? Could there be cases when App have multiple values for key? What about unicode key/values?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done.
Can't have multiple values for a key. I'm not sure we support anything but UTF-8.

@alexandergalstyan
Copy link

Reviewed.

@alexandergalstyan
Copy link

Also I've noticed that R6 lets you store and manage data in JSON format. So, since you're converting everything to json, isn't it reasonable to use that feature?

[Added]
NativeException.cpp
NativeException.h

[Changes]
NativeMessageStrings.h
- added error strings

NativeSimpleDBInterface.cpp
- throw exceptions
- change simpleKey to VARCHAR(255)

NativeSimpleDBInterface.cpp/h, TiAppPropertiesObject.cpp/h
- use const string&

TiAppPropertiesObject.cpp
- fix formatting
- convert NativeException to ThrowException
@dlifshitz-maca
Copy link
Author

Updated. As discussed, the R6 JSON stuff is only to store single JSON objects

@alexandergalstyan
Copy link

Approved with minor comment

jpl-mac pushed a commit that referenced this pull request Jul 24, 2012
TIMOB-9550: BlackBerry: Implement App elements needed for KitchenSink
@jpl-mac jpl-mac merged commit e82d2fc into Macadamian:blackberry Jul 24, 2012
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
3 participants