Amarok/Development/TODO/Refactoring

From KDE Community Wiki
Revision as of 16:56, 9 November 2015 by Ochurlaud (talk | contribs) (→‎Self coherence)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
The printable version is no longer supported and may have rendering errors. Please update your browser bookmarks and please use the default browser print function instead.

QUrls

  • Use QUrl and store QUrl instead of always changing them to strings
  • Often we see parts of code like below, it makes no sense. Just take the string if the URL is not used!!!
   QUrl url = QUrl::fromLocalFile(dataPath( "data/playlists/test.m3u" ));
   QFile file (url.toLocalFile);

QDir

  • Do not use QDir::toNativeSeparor or QDir::Separator when we don't want to show them to the user: Qt does everything with '/' (even on windows!!)

Self coherence

  • In playlists, url.uidUrl() returns a QUrl, in tracks it returns url.url(). Idem for SqlPodcastChannel, ....