How to include the part name in the header of classicthesis scrreprt?

How could I include the part name in front of the chapter name in the header of odd pages within a classicthesis scrreprt document?

The original section in classicthesis.sty reads as follows:

% ******************************************************************
% ********************************************************************
\PassOptionsToPackage{automark}{scrpage2}
\RequirePackage{scrpage2} % provides headers and footers (KOMA Script)
\ifthenelse{\boolean{@nochapters}}%
{\relax}%
{\renewcommand{\chaptermark}[1]{\markboth{\spacedlowsmallcaps{#1}}{\spacedlowsmallcaps{#1}}}}
\renewcommand{\sectionmark}[1]{\markright{\thesection\enspace\spacedlowsmallcaps{#1}}}
% hack to get the content headlines right (thanks, Lorenzo!)
\ifthenelse{\boolean{@nochapters}}%
{\section*{\contentsname}}%nochapters
{\chapter*{\contentsname}}%chapters
\@mkboth{\spacedlowsmallcaps{\contentsname}}{\spacedlowsmallcaps{\contentsname}}}


It results in a header with the actual chapter name on odd pages and the sections name on even pages. Do I have to include something like \renewcommand{\partmark}? What exactly is \headmark doing? Again, the aim is to include the part name (not the number) in the header.

This might work:

\documentclass{scrbook}
\usepackage[parts]{classicthesis}
\usepackage{xpatch}

\usepackage{kantlipsum}

\xpatchcmd{\Part}
{\ctparttext}
{\gdef\thisparttitle{#1}\ctparttext}
{}{}
\renewcommand{\chaptermark}[1]{%
\if\relax\detokenize\expandafter{\thisparttitle}\relax
\markboth{\spacedlowsmallcaps{#1}}
{\spacedlowsmallcaps{#1}}%
\else
\markboth{\spacedlowsmallcaps{\thisparttitle\relax\ -- #1}}
{\spacedlowsmallcaps{\thisparttitle\relax\ -- #1}}%
\fi
}
\newcommand{\clearparttitle}{\gdef\thisparttitle{}}

\begin{document}
\mainmatter
\part{First}
\chapter{Title}
\section{Section}
\kant

\appendix
\clearparttitle
\chapter{Appendix}
\kant

\end{document}


You need to remove the part title when you don't want it any more.