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.
Indentation
================================================================================
The older files in JuK are indented using Qt-style. The first level was 4
spaces, the second one tab, the third one tab followed by 4 spaces. I'm not
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
Older versions of JuK had two different indenting schemes. Now all JuK source
code files simply use 4 spaces at all levels. In most cases the style of the
file currently being worked in should be followed. So:
static void foo()
......@@ -138,6 +128,36 @@ Pointer and Reference Operators
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".
================================================================================
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
......
......@@ -39,3 +39,5 @@ namespace ActionCollection
#endif
}
}
// vim: set et sw=4 tw=0 sta:
......@@ -43,3 +43,5 @@ namespace ActionCollection
}
#endif
// vim: set et sw=4 tw=0 sta:
......@@ -177,3 +177,5 @@ void AdvancedSearchDialog::updateButtons()
}
#include "advancedsearchdialog.moc"
// vim: set et sw=4 tw=0 sta:
......@@ -69,3 +69,5 @@ private:
};
#endif
// vim: set et sw=4 tw=0 sta:
......@@ -168,3 +168,5 @@ void aKodePlayer::seekPosition(int position)
#include "akodeplayer.moc"
#endif
// vim: set et sw=4 tw=0 sta:
......@@ -64,3 +64,5 @@ private:
#endif
#endif
// vim: set et sw=4 tw=0 sta:
......@@ -291,4 +291,4 @@ bool ArtsPlayer::serverRunning() const
#endif
// vim: sw=4 ts=8 et
// vim: set et sw=4 tw=0 sta:
......@@ -92,4 +92,4 @@ private:
#endif
#endif
// vim: sw=4 ts=8 et
// vim: set et sw=4 tw=0 sta:
......@@ -321,3 +321,5 @@ void Cache::load()
FileHandle f(fileName, s);
}
}
// vim: set et sw=4 tw=0 sta:
......@@ -67,3 +67,5 @@ private:
};
#endif
// vim: set et sw=4 tw=0 sta:
......@@ -64,4 +64,4 @@ QString CategoryReaderInterface::fixupTrack(const QString &track, unsigned categ
return str;
}
// vim: set et sw=4 ts=4:
// vim: set et sw=4 tw=0 sta:
......@@ -121,4 +121,4 @@ public:
#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()
}
#include "collectionlist.moc"
// vim: set et sw=4 tw=0 sta:
......@@ -198,3 +198,5 @@ private:
};
#endif
// vim: set et sw=4 tw=0 sta:
......@@ -167,4 +167,4 @@ void CoverDialog::removeSelectedCover()
#include "coverdialog.moc"
// vim: set et ts=4 sw=4:
// vim: set et sw=4 tw=0 sta:
......@@ -38,4 +38,4 @@ private slots:
#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()
return 0;
}
// vim: set et ts=4 sw=4:
// vim: set et sw=4 tw=0 sta:
......@@ -60,4 +60,4 @@ protected:
#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
}
}
// vim: set et sw=4 ts=8:
// vim: set et sw=4 tw=0 sta:
......@@ -65,5 +65,7 @@ private:
mutable coverKey m_coverKey;
mutable bool m_needsConverting;
};
#endif
// vim: set et sw=4 tw=0 sta:
......@@ -576,4 +576,4 @@ QDataStream &operator>>(QDataStream &in, CoverData &data)
return in;
}
// vim: set et sw=4 ts=4:
// vim: set et sw=4 tw=0 sta:
......@@ -262,4 +262,4 @@ public:
#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)
#include "deletedialog.moc"
// vim: set et ts=4 sw=4:
// vim: set et sw=4 tw=0 sta:
......@@ -63,4 +63,4 @@ private:
#endif
// vim: set et ts=4 sw=4:
// vim: set et sw=4 tw=0 sta:
......@@ -98,4 +98,4 @@ void DirectoryList::slotRemoveDirectory()
#include "directorylist.moc"
// vim: ts=8
// vim: set et sw=4 tw=0 sta:
......@@ -57,4 +57,4 @@ private:
#endif
// vim:ts=8
// vim: set et sw=4 tw=0 sta:
......@@ -196,3 +196,5 @@ void DynamicPlaylist::slotUpdateItems()
}
#include "dynamicplaylist.moc"
// vim: set et sw=4 tw=0 sta:
......@@ -112,3 +112,5 @@ private:
};
#endif
// vim: set et sw=4 tw=0 sta:
......@@ -84,4 +84,4 @@ void ExampleOptionsDialog::fileModeSelected()
#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
#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)
f.read(s);
return s;
}
// vim: set et sw=4 tw=0 sta:
......@@ -82,3 +82,5 @@ QDataStream &operator<<(QDataStream &s, const FileHandle &f);
CacheDataStream &operator>>(CacheDataStream &s, FileHandle &f);
#endif
// vim: set et sw=4 tw=0 sta:
......@@ -94,3 +94,5 @@ namespace FileHandleProperties
}
#endif
// vim: set et sw=4 tw=0 sta:
......@@ -1049,4 +1049,4 @@ QString FileRenamer::fileName(const CategoryReaderInterface &interface)
#include "filerenamer.moc"
// vim: set et sw=4 ts=8:
// vim: set et sw=4 tw=0 sta:
......@@ -542,4 +542,4 @@ private:
#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()
#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
#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()
#include "filerenameroptions.moc"
// vim: set et ts=4 sw=4:
// vim: set et sw=4 tw=0 sta:
......@@ -76,4 +76,4 @@ private:
#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)
}
#include "folderplaylist.moc"
// vim: set et sw=4 tw=0 sta:
......@@ -42,3 +42,5 @@ QDataStream &operator<<(QDataStream &s, const FolderPlaylist &p);
QDataStream &operator>>(QDataStream &s, FolderPlaylist &p);
#endif
// vim: set et sw=4 tw=0 sta:
......@@ -262,3 +262,5 @@ bool GoogleFetcher::hasImageResults(DOM::HTMLDocument &search)
}
#include "googlefetcher.moc"
// vim: set et sw=4 tw=0 sta:
......@@ -80,3 +80,5 @@ private:
uint m_selectedIndex;
};
#endif
// vim: set et sw=4 tw=0 sta:
......@@ -246,3 +246,5 @@ void CoverIconViewItem::imageResult(KIO::Job *job)
}
#include "googlefetcherdialog.moc"
// vim: set et sw=4 tw=0 sta:
......@@ -92,3 +92,5 @@ private:
};
#endif
// vim: set et sw=4 tw=0 sta:
......@@ -343,4 +343,4 @@ GstState GStreamerPlayer::state() const
#include "gstreamerplayer.moc"
#endif
// vim: set et sw=4:
// vim: set et sw=4 tw=0 sta:
......@@ -77,5 +77,7 @@ private:
#endif
};
#endif
#endif
#endif /* HAVE_GSTREAMER */
#endif /* GSTREAMER_PLAYER_H */
// vim: set et sw=4 tw=0 sta:
......@@ -158,3 +158,5 @@ QDataStream &operator>>(QDataStream &s, HistoryPlaylist &p)
}
#include "historyplaylist.moc"
// vim: set et sw=4 tw=0 sta:
......@@ -70,3 +70,5 @@ QDataStream &operator<<(QDataStream &s, const HistoryPlaylist &p);
QDataStream &operator>>(QDataStream &s, HistoryPlaylist &p);
#endif
// vim: set et sw=4 tw=0 sta:
......@@ -477,3 +477,5 @@ void JuK::slotCheckAlbumNextAction(bool albumRandomEnabled)
}
#include "juk.moc"
// vim: set et sw=4 tw=0 sta:
......@@ -100,3 +100,5 @@ private:
};
#endif
// vim: set et sw=4 tw=0 sta:
......@@ -106,3 +106,5 @@ protected:
};
#endif
// vim: set et sw=4 tw=0 sta:
......@@ -297,4 +297,4 @@ void K3bPlaylistExporter::slotExport()
#include "k3bexporter.moc"
// vim: set et sw=4 ts=4:
// vim: set et sw=4 tw=0 sta:
......@@ -91,4 +91,4 @@ private:
#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
}
#include "keydialog.moc"
// vim: set et sw=4 tw=0 sta:
......@@ -83,3 +83,5 @@ private:
};
#endif // KEYDIALOG_H
// vim: set et sw=4 tw=0 sta:
......@@ -605,4 +605,4 @@ void KTRMLookup::finished()
#endif
// vim: set et ts=8 sw=4:
// vim: set et sw=4 tw=0 sta:
......@@ -195,3 +195,5 @@ private:
#endif
#endif
// vim: set et sw=4 tw=0 sta:
......@@ -94,3 +94,5 @@ int main(int argc, char *argv[])
return a.exec();
}
// vim: set et sw=4 tw=0 sta:
......@@ -156,3 +156,5 @@ QStringList MediaFiles::convertURLsToLocal(const QStringList &urlList, QWidget *
return result;
}
// vim: set et sw=4 tw=0 sta:
......@@ -87,3 +87,5 @@ namespace MediaFiles
}
#endif
// vim: set et sw=4 tw=0 sta:
......@@ -120,3 +120,5 @@ void MusicBrainzLookup::confirmation()
}
#endif
// vim: set et sw=4 tw=0 sta:
......@@ -41,3 +41,5 @@ private:
#endif
#endif
// vim: set et sw=4 tw=0 sta:
......@@ -375,4 +375,4 @@ void HistoryItem::slotAddPlaying()
#include "nowplaying.moc"
// vim: set et sw=4 ts=8:
// vim: set et sw=4 tw=0 sta:
......@@ -180,3 +180,5 @@ private:
};
#endif
// vim: set et sw=4 tw=0 sta:
......@@ -48,3 +48,5 @@ protected:
};
#endif
// vim: set et sw=4 tw=0 sta:
......@@ -688,4 +688,4 @@ void PlayerManager::setRandomPlayMode(const QString &randomMode)
#include "playermanager.moc"
// vim: set et ts=4 sw=4:
// vim: set et sw=4 tw=0 sta:
......@@ -117,3 +117,5 @@ private:
};
#endif
// vim: set et sw=4 tw=0 sta:
......@@ -2352,3 +2352,5 @@ bool processEvents()
}
#include "playlist.moc"
// vim: set et sw=4 tw=0 sta:
......@@ -790,3 +790,5 @@ void Playlist::createItems(const Q3ValueList<SiblingType *> &siblings, ItemType
}
#endif
// vim: set et sw=4 tw=0 sta:
......@@ -796,3 +796,5 @@ void PlaylistBox::Item::init()
}
#include "playlistbox.moc"
// vim: set et sw=4 tw=0 sta:
......@@ -194,3 +194,5 @@ private:
};
#endif
// vim: set et sw=4 tw=0 sta:
......@@ -926,4 +926,4 @@ KAction *PlaylistCollection::ActionHandler::createAction(const QString &text,
#undef widget
#include "playlistcollection.moc"
// vim: set et sw=4:
// vim: set et sw=4 tw=0 sta:
......@@ -271,3 +271,5 @@ private:
};
#endif
// vim: set et sw=4 tw=0 sta:
......@@ -46,4 +46,4 @@ public:
#endif /* PLAYLISTEXPORTER_H */
// vim: set et ts=4 sw=4:
// vim: set et sw=4 tw=0 sta:
......@@ -80,3 +80,5 @@ const PlaylistInterface *PlaylistObserver::playlist() const
{
return m_playlist;
}
// vim: set et sw=4 tw=0 sta:
......@@ -102,3 +102,5 @@ private:
};
#endif
// vim: set et sw=4 tw=0 sta:
......@@ -465,3 +465,5 @@ void PlaylistItem::Pointer::clear(PlaylistItem *item) // static
m_map.remove(item);
item->m_watched = false;
}
// vim: set et sw=4 tw=0 sta:
......@@ -215,3 +215,5 @@ inline kdbgstream &operator<<(kdbgstream &s, const PlaylistItem &item)
}
#endif
// vim: set et sw=4 tw=0 sta:
......@@ -326,3 +326,5 @@ QDataStream &operator>>(QDataStream &s, PlaylistSearch::Component &c)
return s;
}
// vim: set et sw=4 tw=0 sta:
......@@ -150,3 +150,5 @@ QDataStream &operator<<(QDataStream &s, const PlaylistSearch::Component &c);
QDataStream &operator>>(QDataStream &s, PlaylistSearch::Component &c);
#endif
// vim: set et sw=4 tw=0 sta:
......@@ -238,3 +238,5 @@ void PlaylistSplitter::slotPlaylistChanged(QWidget *w)
}
#include "playlistsplitter.moc"
// vim: set et sw=4 tw=0 sta:
......@@ -88,3 +88,5 @@ private:
};
#endif
// vim: set et sw=4 tw=0 sta:
......@@ -113,3 +113,5 @@ QDataStream &operator>>(QDataStream &s, SearchPlaylist &p)
}
#include "searchplaylist.moc"
// vim: set et sw=4 tw=0 sta:
......@@ -46,3 +46,5 @@ QDataStream &operator<<(QDataStream &s, const SearchPlaylist &p);
QDataStream &operator>>(QDataStream &s, SearchPlaylist &p);
#endif
// vim: set et sw=4 tw=0 sta:
......@@ -294,3 +294,5 @@ void SearchWidget::setupLayout()
}
#include "searchwidget.moc"
// vim: set et sw=4 tw=0 sta:
......@@ -112,3 +112,5 @@ private:
};
#endif
// vim: set et sw=4 tw=0 sta:
......@@ -360,4 +360,4 @@ void SliderAction::slotToolbarDestroyed()
#include "slideraction.moc"
// vim: set et sw=4 ts=4:
// vim: set et sw=4 tw=0 sta:
......@@ -99,3 +99,5 @@ private:
};
#endif
// vim: set et sw=4 tw=0 sta:
......@@ -178,3 +178,5 @@ void SortedStringList::traverse(const Node *n, QStringList &list) const
list.append(n->key);
traverse(n->right, list);
}
// vim: set et sw=4 tw=0 sta:
......@@ -57,3 +57,5 @@ private:
};
#endif
// vim: set et sw=4 tw=0 sta:
......@@ -105,3 +105,5 @@ void SplashScreen::processEvents()
setText(loadedText(count));
kapp->processEvents();
}
// vim: set et sw=4 tw=0 sta:
......@@ -50,3 +50,5 @@ private:
};
#endif
// vim: set et sw=4 tw=0 sta:
......@@ -209,3 +209,5 @@ QString StatusLabel::formatTime(int minutes, int seconds) // static
}
#include "statuslabel.moc"
// vim: set et sw=4 tw=0 sta:
......@@ -65,3 +65,5 @@ private:
};
#endif
// vim: set et sw=4 tw=0 sta:
......@@ -312,3 +312,5 @@ T &Hash<T>::Iterator::operator++()
#endif
// vim: set et sw=4 tw=0 sta:
......@@ -73,3 +73,5 @@ Q3CString StringShare::tryShare(const Q3CString& in)
return in;
}
}
// vim: set et sw=4 tw=0 sta:
......@@ -37,3 +37,5 @@ private:
};
#endif
// vim: set et sw=4 tw=0 sta:
......@@ -645,4 +645,4 @@ static bool copyImage(QImage &dest, QImage &src, int x, int y)
#include "systemtray.moc"
// vim: et sw=4 ts=8
// vim: set et sw=4 tw=0 sta:
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.