Legacy
- Moved more legacy checking code to legacy.cpp.
This commit is contained in:
@@ -42,4 +42,63 @@ void legacyAttributeCheck (const std::string& name)
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
void legacyColumnMap (std::string& name)
|
||||
{
|
||||
// One-time initialization, on demand.
|
||||
static std::map <std::string, std::string> legacyMap;
|
||||
if (! legacyMap.size ())
|
||||
{
|
||||
legacyMap["priority_long"] = "priority.long"; // Deprecated.
|
||||
legacyMap["entry_time"] = "entry"; // Deprecated.
|
||||
legacyMap["start_time"] = "start"; // Deprecated.
|
||||
legacyMap["end_time"] = "end"; // Deprecated.
|
||||
legacyMap["countdown"] = "due.countdown"; // Deprecated.
|
||||
legacyMap["countdown_compact"] = "due.countdown"; // Deprecated.
|
||||
legacyMap["age"] = "entry.age"; // Deprecated.
|
||||
legacyMap["age_compact"] = "entry.age"; // Deprecated.
|
||||
legacyMap["active"] = "start.active"; // Deprecated.
|
||||
legacyMap["recurrence_indicator"] = "recur.indicator"; // Deprecated.
|
||||
legacyMap["tag_indicator"] = "tags.indicator"; // Deprecated.
|
||||
legacyMap["description_only"] = "description.desc"; // Deprecated.
|
||||
}
|
||||
|
||||
// If a legacy column was used, complain about it, but modify it anyway.
|
||||
std::map <std::string, std::string>::iterator found = legacyMap.find (name);
|
||||
if (found != legacyMap.end ())
|
||||
{
|
||||
context.footnote (format (STRING_CMD_CUSTOM_OLD_FIELD, name, found->second));
|
||||
name = found->second;
|
||||
}
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
void legacySortColumnMap (std::string& name)
|
||||
{
|
||||
// One-time initialization, on demand.
|
||||
static std::map <std::string, std::string> legacyMap;
|
||||
if (! legacyMap.size ())
|
||||
{
|
||||
legacyMap["priority_long"] = "priority"; // Deprecated
|
||||
legacyMap["entry_time"] = "entry"; // Deprecated
|
||||
legacyMap["start_time"] = "start"; // Deprecated
|
||||
legacyMap["end_time"] = "end"; // Deprecated
|
||||
legacyMap["countdown"] = "due"; // Deprecated
|
||||
legacyMap["countdown_compact"] = "due"; // Deprecated
|
||||
legacyMap["age"] = "entry"; // Deprecated
|
||||
legacyMap["age_compact"] = "entry"; // Deprecated
|
||||
legacyMap["active"] = "start"; // Deprecated
|
||||
legacyMap["recurrence_indicator"] = "recur"; // Deprecated
|
||||
legacyMap["tag_indicator"] = "tags"; // Deprecated
|
||||
legacyMap["description_only"] = "description"; // Deprecated
|
||||
}
|
||||
|
||||
// If a legacy column was used, complain about it, but modify it anyway.
|
||||
std::map <std::string, std::string>::iterator found = legacyMap.find (name);
|
||||
if (found != legacyMap.end ())
|
||||
{
|
||||
context.footnote (format (STRING_CMD_CUSTOM_OLD_SORT, name, found->second));
|
||||
name = found->second;
|
||||
}
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
Reference in New Issue
Block a user