Commit 6f6130ed authored by Michael Pyne's avatar Michael Pyne

Since we're standardizing the source style, figured I'd throw in the Big Huge Vim Modeline

update.

All source now has a vim modeline, and all files use the same modeline (described in HACKING).

This will make it easier for vim users to stay HACKING-compatible in JuK.

svn path=/trunk/KDE/kdemultimedia/juk/; revision=513935
parent 5e7be0ef
...@@ -6,18 +6,8 @@ save us both time when processing patches. ...@@ -6,18 +6,8 @@ save us both time when processing patches.
Indentation Indentation
================================================================================ ================================================================================
The older files in JuK are indented using Qt-style. The first level was 4 Older versions of JuK had two different indenting schemes. Now all JuK source
spaces, the second one tab, the third one tab followed by 4 spaces. I'm not code files simply use 4 spaces at all levels. In most cases the style of the
particularly fond of this style anymore, but it used to be the Emacs default
when using the KDE Emacs scripts.
static void foo()
{
if(bar()) // <-- 4 spaces
baz() // <-- 1 tab
}
Newer files simply use 4 spaces at all levels. In most cases the style of the
file currently being worked in should be followed. So: file currently being worked in should be followed. So:
static void foo() static void foo()
...@@ -138,6 +128,36 @@ Pointer and Reference Operators ...@@ -138,6 +128,36 @@ Pointer and Reference Operators
This one is pretty simple. I prefer "Foo *f" to "Foo* f" in function signatures This one is pretty simple. I prefer "Foo *f" to "Foo* f" in function signatures
and declarations. The same goes for "Foo &f" over "Foo& f". and declarations. The same goes for "Foo &f" over "Foo& f".
================================================================================
Editor Support
================================================================================
Most JuK files that Michael Pyne has touched will eventually have a vim modeline
at the bottom of the file (after any moc #includes). The current vim modeline
is the following:
// vim: set et sw=4 tw=0 sta:
The vim: ... : part encloses the commands to automatically use when opening the
file in vim. The following commands are set:
et : Uses spaces instead of the <TAB> when the Tab key is pressed. No
JuK source should have tab characters anymore, this helps enforce
that. Full name is expandtab.
sw = 4 : Makes indenting levels 4 spaces wide, for use with the vim indenting
features. Full name is shiftwidth.
tw = 0 : Prevents vim from wrapping lines as you are typing. Full name is
textwidth.
sta : Use shiftwidth to determine tab size at the beginning of the line,
instead of tabstop (which is normally 8 spaces wide). Full name is
smarttab.
Also, vim users will want to have the command "let c_space_errors=1" in their
.vimrc in order to flag extra whitespace at the end of lines, which is also a
no-no in source code.
There are vim and emacs scripts for KDE developers in kdesdk/scripts, you may
also want to see what is available there.
================================================================================ ================================================================================
There are likely things missing here and I'll try to add them over time as I There are likely things missing here and I'll try to add them over time as I
......
...@@ -39,3 +39,5 @@ namespace ActionCollection ...@@ -39,3 +39,5 @@ namespace ActionCollection
#endif #endif
} }
} }
// vim: set et sw=4 tw=0 sta:
...@@ -43,3 +43,5 @@ namespace ActionCollection ...@@ -43,3 +43,5 @@ namespace ActionCollection
} }
#endif #endif
// vim: set et sw=4 tw=0 sta:
...@@ -177,3 +177,5 @@ void AdvancedSearchDialog::updateButtons() ...@@ -177,3 +177,5 @@ void AdvancedSearchDialog::updateButtons()
} }
#include "advancedsearchdialog.moc" #include "advancedsearchdialog.moc"
// vim: set et sw=4 tw=0 sta:
...@@ -69,3 +69,5 @@ private: ...@@ -69,3 +69,5 @@ private:
}; };
#endif #endif
// vim: set et sw=4 tw=0 sta:
...@@ -168,3 +168,5 @@ void aKodePlayer::seekPosition(int position) ...@@ -168,3 +168,5 @@ void aKodePlayer::seekPosition(int position)
#include "akodeplayer.moc" #include "akodeplayer.moc"
#endif #endif
// vim: set et sw=4 tw=0 sta:
...@@ -64,3 +64,5 @@ private: ...@@ -64,3 +64,5 @@ private:
#endif #endif
#endif #endif
// vim: set et sw=4 tw=0 sta:
...@@ -291,4 +291,4 @@ bool ArtsPlayer::serverRunning() const ...@@ -291,4 +291,4 @@ bool ArtsPlayer::serverRunning() const
#endif #endif
// vim: sw=4 ts=8 et // vim: set et sw=4 tw=0 sta:
...@@ -92,4 +92,4 @@ private: ...@@ -92,4 +92,4 @@ private:
#endif #endif
#endif #endif
// vim: sw=4 ts=8 et // vim: set et sw=4 tw=0 sta:
...@@ -321,3 +321,5 @@ void Cache::load() ...@@ -321,3 +321,5 @@ void Cache::load()
FileHandle f(fileName, s); FileHandle f(fileName, s);
} }
} }
// vim: set et sw=4 tw=0 sta:
...@@ -67,3 +67,5 @@ private: ...@@ -67,3 +67,5 @@ private:
}; };
#endif #endif
// vim: set et sw=4 tw=0 sta:
...@@ -64,4 +64,4 @@ QString CategoryReaderInterface::fixupTrack(const QString &track, unsigned categ ...@@ -64,4 +64,4 @@ QString CategoryReaderInterface::fixupTrack(const QString &track, unsigned categ
return str; return str;
} }
// vim: set et sw=4 ts=4: // vim: set et sw=4 tw=0 sta:
...@@ -121,4 +121,4 @@ public: ...@@ -121,4 +121,4 @@ public:
#endif /* JUK_CATEGORYREADERINTERFACE_H */ #endif /* JUK_CATEGORYREADERINTERFACE_H */
// vim: set et sw=4 ts=4: // vim: set et sw=4 tw=0 sta:
...@@ -513,3 +513,5 @@ bool CollectionListItem::checkCurrent() ...@@ -513,3 +513,5 @@ bool CollectionListItem::checkCurrent()
} }
#include "collectionlist.moc" #include "collectionlist.moc"
// vim: set et sw=4 tw=0 sta:
...@@ -198,3 +198,5 @@ private: ...@@ -198,3 +198,5 @@ private:
}; };
#endif #endif
// vim: set et sw=4 tw=0 sta:
...@@ -167,4 +167,4 @@ void CoverDialog::removeSelectedCover() ...@@ -167,4 +167,4 @@ void CoverDialog::removeSelectedCover()
#include "coverdialog.moc" #include "coverdialog.moc"
// vim: set et ts=4 sw=4: // vim: set et sw=4 tw=0 sta:
...@@ -38,4 +38,4 @@ private slots: ...@@ -38,4 +38,4 @@ private slots:
#endif /* JUK_COVERDIALOG_H */ #endif /* JUK_COVERDIALOG_H */
// vim: set et ts=4 sw=4: // vim: set et sw=4 tw=0 sta:
...@@ -45,4 +45,4 @@ Q3DragObject *CoverIconView::dragObject() ...@@ -45,4 +45,4 @@ Q3DragObject *CoverIconView::dragObject()
return 0; return 0;
} }
// vim: set et ts=4 sw=4: // vim: set et sw=4 tw=0 sta:
...@@ -60,4 +60,4 @@ protected: ...@@ -60,4 +60,4 @@ protected:
#endif /* JUK_COVERICONVIEW_H */ #endif /* JUK_COVERICONVIEW_H */
// vim: set et ts=4 sw=4: // vim: set et sw=4 tw=0 sta:
...@@ -287,4 +287,4 @@ bool CoverInfo::convertOldStyleCover() const ...@@ -287,4 +287,4 @@ bool CoverInfo::convertOldStyleCover() const
} }
} }
// vim: set et sw=4 ts=8: // vim: set et sw=4 tw=0 sta:
...@@ -65,5 +65,7 @@ private: ...@@ -65,5 +65,7 @@ private:
mutable coverKey m_coverKey; mutable coverKey m_coverKey;
mutable bool m_needsConverting; mutable bool m_needsConverting;
}; };
#endif #endif
// vim: set et sw=4 tw=0 sta:
...@@ -576,4 +576,4 @@ QDataStream &operator>>(QDataStream &in, CoverData &data) ...@@ -576,4 +576,4 @@ QDataStream &operator>>(QDataStream &in, CoverData &data)
return in; return in;
} }
// vim: set et sw=4 ts=4: // vim: set et sw=4 tw=0 sta:
...@@ -262,4 +262,4 @@ public: ...@@ -262,4 +262,4 @@ public:
#endif /* JUK_COVERMANAGER_H */ #endif /* JUK_COVERMANAGER_H */
// vim: set et sw=4 ts=4: // vim: set et sw=4 tw=0 sta:
...@@ -118,4 +118,4 @@ void DeleteDialog::slotShouldDelete(bool shouldDelete) ...@@ -118,4 +118,4 @@ void DeleteDialog::slotShouldDelete(bool shouldDelete)
#include "deletedialog.moc" #include "deletedialog.moc"
// vim: set et ts=4 sw=4: // vim: set et sw=4 tw=0 sta:
...@@ -63,4 +63,4 @@ private: ...@@ -63,4 +63,4 @@ private:
#endif #endif
// vim: set et ts=4 sw=4: // vim: set et sw=4 tw=0 sta:
...@@ -98,4 +98,4 @@ void DirectoryList::slotRemoveDirectory() ...@@ -98,4 +98,4 @@ void DirectoryList::slotRemoveDirectory()
#include "directorylist.moc" #include "directorylist.moc"
// vim: ts=8 // vim: set et sw=4 tw=0 sta:
...@@ -57,4 +57,4 @@ private: ...@@ -57,4 +57,4 @@ private:
#endif #endif
// vim:ts=8 // vim: set et sw=4 tw=0 sta:
...@@ -196,3 +196,5 @@ void DynamicPlaylist::slotUpdateItems() ...@@ -196,3 +196,5 @@ void DynamicPlaylist::slotUpdateItems()
} }
#include "dynamicplaylist.moc" #include "dynamicplaylist.moc"
// vim: set et sw=4 tw=0 sta:
...@@ -112,3 +112,5 @@ private: ...@@ -112,3 +112,5 @@ private:
}; };
#endif #endif
// vim: set et sw=4 tw=0 sta:
...@@ -84,4 +84,4 @@ void ExampleOptionsDialog::fileModeSelected() ...@@ -84,4 +84,4 @@ void ExampleOptionsDialog::fileModeSelected()
#include "exampleoptions.moc" #include "exampleoptions.moc"
// vim: set et sw=4 ts=4: // vim: set et sw=4 tw=0 sta:
...@@ -63,4 +63,4 @@ class ExampleOptionsDialog : public QDialog ...@@ -63,4 +63,4 @@ class ExampleOptionsDialog : public QDialog
#endif /* JUK_EXAMPLEOPTIONS_H */ #endif /* JUK_EXAMPLEOPTIONS_H */
// vim: set et sw=4 ts=4: // vim: set et sw=4 tw=0 sta:
...@@ -296,3 +296,5 @@ CacheDataStream &operator>>(CacheDataStream &s, FileHandle &f) ...@@ -296,3 +296,5 @@ CacheDataStream &operator>>(CacheDataStream &s, FileHandle &f)
f.read(s); f.read(s);
return s; return s;
} }
// vim: set et sw=4 tw=0 sta:
...@@ -82,3 +82,5 @@ QDataStream &operator<<(QDataStream &s, const FileHandle &f); ...@@ -82,3 +82,5 @@ QDataStream &operator<<(QDataStream &s, const FileHandle &f);
CacheDataStream &operator>>(CacheDataStream &s, FileHandle &f); CacheDataStream &operator>>(CacheDataStream &s, FileHandle &f);
#endif #endif
// vim: set et sw=4 tw=0 sta:
...@@ -94,3 +94,5 @@ namespace FileHandleProperties ...@@ -94,3 +94,5 @@ namespace FileHandleProperties
} }
#endif #endif
// vim: set et sw=4 tw=0 sta:
...@@ -1049,4 +1049,4 @@ QString FileRenamer::fileName(const CategoryReaderInterface &interface) ...@@ -1049,4 +1049,4 @@ QString FileRenamer::fileName(const CategoryReaderInterface &interface)
#include "filerenamer.moc" #include "filerenamer.moc"
// vim: set et sw=4 ts=8: // vim: set et sw=4 tw=0 sta:
...@@ -542,4 +542,4 @@ private: ...@@ -542,4 +542,4 @@ private:
#endif /* JUK_FILERENAMER_H */ #endif /* JUK_FILERENAMER_H */
// vim: set et sw=4 ts=8: // vim: set et sw=4 tw=0 sta:
...@@ -40,4 +40,4 @@ void FileRenamerConfigDlg::accept() ...@@ -40,4 +40,4 @@ void FileRenamerConfigDlg::accept()
#include "filerenamerconfigdlg.moc" #include "filerenamerconfigdlg.moc"
// vim: set et sw=4 ts=4: // vim: set et sw=4 tw=0 sta:
...@@ -35,4 +35,4 @@ class FileRenamerConfigDlg : public KDialogBase ...@@ -35,4 +35,4 @@ class FileRenamerConfigDlg : public KDialogBase
#endif // FILERENAMERCONFIGDLG_H #endif // FILERENAMERCONFIGDLG_H
// vim: set et ts=4 sw=4: // vim: set et sw=4 tw=0 sta:
...@@ -162,4 +162,4 @@ void TagOptionsDialog::saveConfig() ...@@ -162,4 +162,4 @@ void TagOptionsDialog::saveConfig()
#include "filerenameroptions.moc" #include "filerenameroptions.moc"
// vim: set et ts=4 sw=4: // vim: set et sw=4 tw=0 sta:
...@@ -76,4 +76,4 @@ private: ...@@ -76,4 +76,4 @@ private:
#endif /* JUK_FILERENAMEROPTIONS_H */ #endif /* JUK_FILERENAMEROPTIONS_H */
// vim: set et ts=4 sw=4: // vim: set et sw=4 tw=0 sta:
...@@ -79,3 +79,5 @@ QDataStream &operator>>(QDataStream &s, FolderPlaylist &p) ...@@ -79,3 +79,5 @@ QDataStream &operator>>(QDataStream &s, FolderPlaylist &p)
} }
#include "folderplaylist.moc" #include "folderplaylist.moc"
// vim: set et sw=4 tw=0 sta:
...@@ -42,3 +42,5 @@ QDataStream &operator<<(QDataStream &s, const FolderPlaylist &p); ...@@ -42,3 +42,5 @@ QDataStream &operator<<(QDataStream &s, const FolderPlaylist &p);
QDataStream &operator>>(QDataStream &s, FolderPlaylist &p); QDataStream &operator>>(QDataStream &s, FolderPlaylist &p);
#endif #endif
// vim: set et sw=4 tw=0 sta:
...@@ -262,3 +262,5 @@ bool GoogleFetcher::hasImageResults(DOM::HTMLDocument &search) ...@@ -262,3 +262,5 @@ bool GoogleFetcher::hasImageResults(DOM::HTMLDocument &search)
} }
#include "googlefetcher.moc" #include "googlefetcher.moc"
// vim: set et sw=4 tw=0 sta:
...@@ -80,3 +80,5 @@ private: ...@@ -80,3 +80,5 @@ private:
uint m_selectedIndex; uint m_selectedIndex;
}; };
#endif #endif
// vim: set et sw=4 tw=0 sta:
...@@ -246,3 +246,5 @@ void CoverIconViewItem::imageResult(KIO::Job *job) ...@@ -246,3 +246,5 @@ void CoverIconViewItem::imageResult(KIO::Job *job)
} }
#include "googlefetcherdialog.moc" #include "googlefetcherdialog.moc"
// vim: set et sw=4 tw=0 sta:
...@@ -92,3 +92,5 @@ private: ...@@ -92,3 +92,5 @@ private:
}; };
#endif #endif
// vim: set et sw=4 tw=0 sta:
...@@ -343,4 +343,4 @@ GstState GStreamerPlayer::state() const ...@@ -343,4 +343,4 @@ GstState GStreamerPlayer::state() const
#include "gstreamerplayer.moc" #include "gstreamerplayer.moc"
#endif #endif
// vim: set et sw=4: // vim: set et sw=4 tw=0 sta:
...@@ -77,5 +77,7 @@ private: ...@@ -77,5 +77,7 @@ private:
#endif #endif
}; };
#endif #endif /* HAVE_GSTREAMER */
#endif #endif /* GSTREAMER_PLAYER_H */
// vim: set et sw=4 tw=0 sta:
...@@ -158,3 +158,5 @@ QDataStream &operator>>(QDataStream &s, HistoryPlaylist &p) ...@@ -158,3 +158,5 @@ QDataStream &operator>>(QDataStream &s, HistoryPlaylist &p)
} }
#include "historyplaylist.moc" #include "historyplaylist.moc"
// vim: set et sw=4 tw=0 sta:
...@@ -70,3 +70,5 @@ QDataStream &operator<<(QDataStream &s, const HistoryPlaylist &p); ...@@ -70,3 +70,5 @@ QDataStream &operator<<(QDataStream &s, const HistoryPlaylist &p);
QDataStream &operator>>(QDataStream &s, HistoryPlaylist &p); QDataStream &operator>>(QDataStream &s, HistoryPlaylist &p);
#endif #endif
// vim: set et sw=4 tw=0 sta:
...@@ -477,3 +477,5 @@ void JuK::slotCheckAlbumNextAction(bool albumRandomEnabled) ...@@ -477,3 +477,5 @@ void JuK::slotCheckAlbumNextAction(bool albumRandomEnabled)
} }
#include "juk.moc" #include "juk.moc"
// vim: set et sw=4 tw=0 sta:
...@@ -100,3 +100,5 @@ private: ...@@ -100,3 +100,5 @@ private:
}; };
#endif #endif
// vim: set et sw=4 tw=0 sta:
...@@ -106,3 +106,5 @@ protected: ...@@ -106,3 +106,5 @@ protected:
}; };
#endif #endif
// vim: set et sw=4 tw=0 sta:
...@@ -297,4 +297,4 @@ void K3bPlaylistExporter::slotExport() ...@@ -297,4 +297,4 @@ void K3bPlaylistExporter::slotExport()
#include "k3bexporter.moc" #include "k3bexporter.moc"
// vim: set et sw=4 ts=4: // vim: set et sw=4 tw=0 sta:
...@@ -91,4 +91,4 @@ private: ...@@ -91,4 +91,4 @@ private:
#endif /* K3BEXPORTER_H */ #endif /* K3BEXPORTER_H */
// vim: set et ts=4 sw=4: // vim: set et sw=4 tw=0 sta:
...@@ -202,3 +202,5 @@ void KeyDialog::insert(KGlobalAccel *keys, const QString &action, const QString ...@@ -202,3 +202,5 @@ void KeyDialog::insert(KGlobalAccel *keys, const QString &action, const QString
} }
#include "keydialog.moc" #include "keydialog.moc"
// vim: set et sw=4 tw=0 sta:
...@@ -83,3 +83,5 @@ private: ...@@ -83,3 +83,5 @@ private:
}; };
#endif // KEYDIALOG_H #endif // KEYDIALOG_H
// vim: set et sw=4 tw=0 sta:
...@@ -605,4 +605,4 @@ void KTRMLookup::finished() ...@@ -605,4 +605,4 @@ void KTRMLookup::finished()
#endif #endif
// vim: set et ts=8 sw=4: // vim: set et sw=4 tw=0 sta:
...@@ -195,3 +195,5 @@ private: ...@@ -195,3 +195,5 @@ private:
#endif #endif
#endif #endif
// vim: set et sw=4 tw=0 sta:
...@@ -94,3 +94,5 @@ int main(int argc, char *argv[]) ...@@ -94,3 +94,5 @@ int main(int argc, char *argv[])
return a.exec(); return a.exec();
} }
// vim: set et sw=4 tw=0 sta:
...@@ -156,3 +156,5 @@ QStringList MediaFiles::convertURLsToLocal(const QStringList &urlList, QWidget * ...@@ -156,3 +156,5 @@ QStringList MediaFiles::convertURLsToLocal(const QStringList &urlList, QWidget *
return result; return result;
} }
// vim: set et sw=4 tw=0 sta:
...@@ -87,3 +87,5 @@ namespace MediaFiles ...@@ -87,3 +87,5 @@ namespace MediaFiles
} }
#endif #endif
// vim: set et sw=4 tw=0 sta:
...@@ -120,3 +120,5 @@ void MusicBrainzLookup::confirmation() ...@@ -120,3 +120,5 @@ void MusicBrainzLookup::confirmation()
} }
#endif #endif
// vim: set et sw=4 tw=0 sta:
...@@ -41,3 +41,5 @@ private: ...@@ -41,3 +41,5 @@ private:
#endif #endif
#endif #endif
// vim: set et sw=4 tw=0 sta:
...@@ -375,4 +375,4 @@ void HistoryItem::slotAddPlaying() ...@@ -375,4 +375,4 @@ void HistoryItem::slotAddPlaying()
#include "nowplaying.moc" #include "nowplaying.moc"
// vim: set et sw=4 ts=8: // vim: set et sw=4 tw=0 sta:
...@@ -180,3 +180,5 @@ private: ...@@ -180,3 +180,5 @@ private:
}; };
#endif #endif
// vim: set et sw=4 tw=0 sta:
...@@ -48,3 +48,5 @@ protected: ...@@ -48,3 +48,5 @@ protected:
}; };
#endif #endif
// vim: set et sw=4 tw=0 sta:
...@@ -688,4 +688,4 @@ void PlayerManager::setRandomPlayMode(const QString &randomMode) ...@@ -688,4 +688,4 @@ void PlayerManager::setRandomPlayMode(const QString &randomMode)
#include "playermanager.moc" #include "playermanager.moc"
// vim: set et ts=4 sw=4: // vim: set et sw=4 tw=0 sta:
...@@ -117,3 +117,5 @@ private: ...@@ -117,3 +117,5 @@ private:
}; };
#endif #endif
// vim: set et sw=4 tw=0 sta:
...@@ -2352,3 +2352,5 @@ bool processEvents() ...@@ -2352,3 +2352,5 @@ bool processEvents()
} }
#include "playlist.moc"