Removed some references to getTag (which is renamed to getTagByName)

pull/14/head
Sam Bosley 12 years ago
parent f10b3acc31
commit 5a139463ae

@ -512,7 +512,7 @@ public class AstridNewSyncMigrator {
private void updateTagUuid(Metadata m) {
String tag = m.getValue(TaskToTagMetadata.TAG_NAME);
TagData tagData = tagDataService.getTag(tag, TagData.UUID);
TagData tagData = tagDataService.getTagByName(tag, TagData.UUID);
if (tagData != null) {
if (ActFmInvoker.SYNC_DEBUG)
Log.w(LOG_TAG, "Linking with tag uuid " + tagData.getValue(TagData.UUID));

@ -178,7 +178,7 @@ public class CalendarReminderActivity extends Activity {
@Override
public void onClick(View v) {
String listName = getString(R.string.CRA_default_list_name, eventName);
TagData existing = tagDataService.getTag(listName, TagData.PROPERTIES);
TagData existing = tagDataService.getTagByName(listName, TagData.PROPERTIES);
if (existing != null) {
listExists(existing);
} else {

@ -60,7 +60,7 @@ public class SubtasksHelper {
public static String applySubtasksToWidgetFilter(Filter filter, String query, String tagName, int limit) {
if (SubtasksHelper.shouldUseSubtasksFragmentForFilter(filter)) {
// care for manual ordering
TagData tagData = PluginServices.getTagDataService().getTag(tagName, TagData.UUID, TagData.TAG_ORDERING);
TagData tagData = PluginServices.getTagDataService().getTagByName(tagName, TagData.UUID, TagData.TAG_ORDERING);
TaskListMetadataDao tlmd = PluginServices.getTaskListMetadataDao();
TaskListMetadata tlm = null;
if (tagData != null) {

@ -38,6 +38,7 @@ import com.todoroo.astrid.api.FilterCategory;
import com.todoroo.astrid.api.FilterListItem;
import com.todoroo.astrid.api.FilterWithCustomIntent;
import com.todoroo.astrid.api.FilterWithUpdate;
import com.todoroo.astrid.dao.TagDataDao;
import com.todoroo.astrid.dao.TaskDao.TaskCriteria;
import com.todoroo.astrid.data.Metadata;
import com.todoroo.astrid.data.RemoteModel;
@ -200,7 +201,7 @@ public class TagFilterExposer extends BroadcastReceiver implements AstridFilterE
protected String uuid;
@Autowired public TagService tagService;
@Autowired public TagDataService tagDataService;
@Autowired public TagDataDao tagDataDao;
static {
AstridDependencyInjector.initialize();
@ -220,7 +221,7 @@ public class TagFilterExposer extends BroadcastReceiver implements AstridFilterE
DependencyInjectionService.getInstance().inject(this);
TagData tagData = tagDataService.getTag(tag, TagData.MEMBER_COUNT, TagData.USER_ID);
TagData tagData = tagDataDao.fetch(uuid, TagData.MEMBER_COUNT, TagData.USER_ID);
if(tagData != null && tagData.getValue(TagData.MEMBER_COUNT) > 0 && Task.USER_ID_SELF.equals(tagData.getValue(TagData.USER_ID))) {
DialogUtilities.okCancelDialog(this, getString(R.string.actfm_tag_operation_owner_delete), getOkListener(), getCancelListener());
return;
@ -310,10 +311,10 @@ public class TagFilterExposer extends BroadcastReceiver implements AstridFilterE
return false;
} else {
int renamed = tagService.rename(tag, text);
TagData tagData = tagDataService.getTag(tag, TagData.ID, TagData.NAME);
TagData tagData = tagDataDao.fetch(uuid, TagData.ID, TagData.NAME);
if (tagData != null) {
tagData.setValue(TagData.NAME, text);
tagDataService.save(tagData);
tagDataDao.saveExisting(tagData);
}
Toast.makeText(this, getString(R.string.TEA_tags_renamed, tag, text, renamed),
Toast.LENGTH_SHORT).show();

@ -89,7 +89,7 @@ public class TagDataService {
* Find a tag by name
* @return null if doesn't exist
*/
public TagData getTag(String name, Property<?>... properties) {
public TagData getTagByName(String name, Property<?>... properties) {
TodorooCursor<TagData> cursor = tagDataDao.query(Query.select(properties).where(TagData.NAME.eqCaseInsensitive(name)));
try {
if(cursor.getCount() == 0)

@ -428,7 +428,7 @@ public class TasksWidget extends AppWidgetProvider {
}
}
} else {
tagData = tagDataService.getTag(filter.title, TagData.ID);
tagData = tagDataService.getTagByName(filter.title, TagData.ID);
if (tagData != null)
Preferences.setLong(WidgetConfigActivity.PREF_TAG_ID + widgetId, tagData.getId());
}

Loading…
Cancel
Save