diff --git a/crates/cxx-qt-gen/src/generator/cpp/signal.rs b/crates/cxx-qt-gen/src/generator/cpp/signal.rs index 22bedc907..61045d920 100644 --- a/crates/cxx-qt-gen/src/generator/cpp/signal.rs +++ b/crates/cxx-qt-gen/src/generator/cpp/signal.rs @@ -8,7 +8,7 @@ use crate::{ cpp::{fragment::CppFragment, qobject::GeneratedCppQObjectBlocks}, naming::{ qobject::QObjectNames, - signals::{QSignalHelperName, QSignalName}, + signals::{QSignalHelperNames, QSignalNames}, }, }, naming::{cpp::syn_type_to_cpp_type, Name, TypeNames}, @@ -94,8 +94,8 @@ pub fn generate_cpp_signal( let qobject_ident_namespaced = qobject_name.cxx_qualified(); // Prepare the idents - let idents = QSignalName::from(signal); - let idents_helper = QSignalHelperName::new(&idents, qobject_name)?; + let idents = QSignalNames::from(signal); + let idents_helper = QSignalHelperNames::new(&idents, qobject_name)?; let signal_ident = idents.name.cxx_unqualified(); let free_connect_ident_cpp = idents_helper.connect_name.cxx_unqualified(); diff --git a/crates/cxx-qt-gen/src/generator/naming/signals.rs b/crates/cxx-qt-gen/src/generator/naming/signals.rs index 675ce6ad6..4e4cb151f 100644 --- a/crates/cxx-qt-gen/src/generator/naming/signals.rs +++ b/crates/cxx-qt-gen/src/generator/naming/signals.rs @@ -8,13 +8,13 @@ use quote::format_ident; use syn::{Ident, Result}; /// Names for parts of a Q_SIGNAL -pub struct QSignalName { +pub struct QSignalNames { pub name: Name, pub connect_name: Name, pub on_name: Ident, } -impl From<&ParsedSignal> for QSignalName { +impl From<&ParsedSignal> for QSignalNames { fn from(signal: &ParsedSignal) -> Self { Self { name: signal.name.clone(), @@ -36,7 +36,7 @@ fn on_from_signal(ident: &Ident) -> Ident { format_ident!("on_{}", ident.to_string().to_case(Case::Snake)) } -pub struct QSignalHelperName { +pub struct QSignalHelperNames { pub connect_name: Name, pub function_call: Ident, pub function_drop: Ident, @@ -47,8 +47,8 @@ pub struct QSignalHelperName { pub struct_param: Ident, } -impl QSignalHelperName { - pub fn new(idents: &QSignalName, qobject_name: &Name) -> Result { +impl QSignalHelperNames { + pub fn new(idents: &QSignalNames, qobject_name: &Name) -> Result { let signal_ident = &idents.name.cxx_unqualified(); let qobject_ident = qobject_name.rust_unqualified().to_string(); let handler_alias = format_ident!("{qobject_ident}CxxQtSignalHandler{signal_ident}"); @@ -120,7 +120,7 @@ mod tests { private: false, }; - let names = QSignalName::from(&qsignal); + let names = QSignalNames::from(&qsignal); assert_eq!(names.name.cxx_unqualified(), "dataChanged"); assert_eq!( names.name.rust_unqualified(), @@ -150,7 +150,7 @@ mod tests { private: false, }; - let names = QSignalName::from(&qsignal); + let names = QSignalNames::from(&qsignal); assert_eq!(names.name.cxx_unqualified(), "baseName"); assert_eq!( names.name.rust_unqualified(), diff --git a/crates/cxx-qt-gen/src/generator/rust/signals.rs b/crates/cxx-qt-gen/src/generator/rust/signals.rs index 8ca1d466f..3eb428d01 100644 --- a/crates/cxx-qt-gen/src/generator/rust/signals.rs +++ b/crates/cxx-qt-gen/src/generator/rust/signals.rs @@ -7,7 +7,7 @@ use crate::{ generator::{ naming::{ qobject::QObjectNames, - signals::{QSignalHelperName, QSignalName}, + signals::{QSignalHelperNames, QSignalNames}, }, rust::fragment::{GeneratedRustFragment, RustFragmentPair}, }, @@ -24,8 +24,8 @@ pub fn generate_rust_signal( type_names: &TypeNames, module_ident: &Ident, ) -> Result { - let idents = QSignalName::from(signal); - let idents_helper = QSignalHelperName::new(&idents, qobject_name)?; + let idents = QSignalNames::from(signal); + let idents_helper = QSignalHelperNames::new(&idents, qobject_name)?; let qobject_name_rust = qobject_name.rust_unqualified(); @@ -220,7 +220,7 @@ pub fn generate_rust_signals( if attribute_find_path(&signal.method.attrs, &["cxx_name"]).is_none() && attribute_find_path(&signal.method.attrs, &["rust_name"]).is_none() { - let idents = QSignalName::from(&signal); + let idents = QSignalNames::from(&signal); let signal_name_cpp = idents.name.cxx_unqualified(); signal .method