Amarok/Development/TODO/Refactoring: Difference between revisions

From KDE Community Wiki
(Created page with "== QUrls == * Use QUrl and store QUrl instead of always changing them to strings == QDir == * Do not use QDir::toNativeSeparor or QDir::Separator when we don't want to show t...")
 
Line 1: Line 1:
== QUrls ==
== QUrls ==
* Use QUrl and store QUrl instead of always changing them to strings
* 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 ==
== 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!!)
* 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!!)

Revision as of 16:18, 9 November 2015

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!!)