Introduction
In this question I want to know when calculating the entropy change where we take the temperature of the system or the reservoir's and if my thought process is sound.
Clausius Theorem
The state function of Entropy is defined by the Clausius's Theorem which in short is stated by the equation: $$ \int\limits_{\text{cycle}} \frac{\mathrm{d}Q}{T}\leq 0 \,.$$
And the equality stands only when the heat is transferred reversibly around the cycle.
Comments on the variable in the inequality
From the process of proving the theorem I understood that the temperature $T$ is the temperature of the reservoir between the Carnot Engine and the system that we study.
Entropy
Entropy is defined as $$ \mathrm{d}S= \frac{\mathrm{d}Q_{\text{rev}}}{T} \,,$$ so as to be an exact differential and therefore a state function.
Comments on Entropy
As I came to understand the only way to transfer energy through heat reversibly is for the temperatures of the two bodies in thermal contact to be the same. So the temperature $T$ in the above equation which is the temperature of the reservoir (or whatever) is to be the same as the system's one. Therefore the temperature $T$ in the equation is the temperature of the system. RIGHT?